Class FragmentationPlugin

    • Field Detail

      • LOG

        private static final org.slf4j.Logger LOG
    • Constructor Detail

      • FragmentationPlugin

        public FragmentationPlugin()
    • Method Detail

      • loadFragmentState

        public static void loadFragmentState​(StateVertex fragState,
                                             FragmentManager manager,
                                             Document dom,
                                             BufferedImage screenshot)
        Loads a statevertex in an offline setting using a previously fragmented and recorded DOM. This is useful to determine the similarity between a previously recorded state and the current browser state in a regression test scenario.
        Parameters:
        fragState -
        manager -
        dom -
        screenshot -
      • fragmentState

        public static void fragmentState​(StateVertex newState,
                                         FragmentManager manager,
                                         EmbeddedBrowser browser,
                                         File outputDir,
                                         boolean exportDom)
        Main function that gets called everytime a new state is discovered. Uses VIPS to perform fragmentation and calls fragment manager to analyze fragments
        Parameters:
        newState -
        manager -
        browser -
        outputDir -
        exportDom -
      • writeCrawlPath

        public static void writeCrawlPath​(CrawlSession session,
                                          CrawlPath crawlPath,
                                          int id)
      • onRevisitState

        public void onRevisitState​(CrawlerContext context,
                                   StateVertex currentState)
        Description copied from interface: OnRevisitStatePlugin
        Method that is called every time a state is revisited by Crawljax. Warning: changing the state can influence crawljax, it is not a copy.

        This method can be called from multiple threads with different CrawlerContext

        Specified by:
        onRevisitState in interface OnRevisitStatePlugin
        Parameters:
        context - the crawlSession
        currentState - the state revisited