Skip to content

BrowserSessionStateExtractionConfig

mfellingerTestfabrik edited this page Jul 23, 2018 · 9 revisions

State extraction is one of the key elements of webmate, as many jobs require states to work properly and deliver reasonable results. For this reason, we configured this process to be as general as possible. However, there are certain cases where one need to change the configuration of the state extraction process, for example because the website under tests has specific requirements or the performance of the state extraction needs to be optimized.

Usage

To configure the state extraction to your liking, simply create a new BrowserSessionStateExtractionConfig and pass it to the extraction command.

BrowserSessionStateExtractionConfig config = new BrowserSessionStateExtractionConfig(); //sets all entries to null , i.e use webmate default values. config.setExtractionDelay(1000) //set extraction delay to 1 second browserSession.createState("My State", config); //use the config in state extraction

Configuration

The following Tables list all available configuration variables, their effect and their default value. If a variable is set to null, the webmate default value will be choosen instead.

BrowserSessionStateExtractionConfig

Variable Effect Default
stateId Persist the state using this id. Randomly generated id
extractionDelay The delay before state extraction is triggered. 10000 (10 seconds)
extractionCooldown The delay after state extraction is finished. 20000 (20 seconds)
optViewportDimension The dimensions the viewport should be resized to. Do not modify viewport dimensions
maxAdditionWaitingTimeForStateExtraction How much additional time the state extraction should get, after the projected end time is reached and the extraction isn't finished yet. 120000 (120 seconds)
extractDomStateData wether DOM data should be extracted or not. true
screenShotConfig The configuration for the screenshot extraction. See ScreenShotConfig Table for details Do not take screenshots
warmUpConfig The configuration for the warmup. See WarmUpConfig Table for Details. Do not warm up

ScreenshotConfig

Similar to the BrowserSessionStateConfig, if a config variable is set to null, webmate will use its default values. Additionally if any ScreenshotConfig Object is set in the BrowserSessionStateExtractionConfig, webmate will take a screenshot during extraction.

Variable Effect Default
fullpage If set to true, webmate will scroll down all the way to capture the whole length of the webpage on one screenshot. If set to false, webmate will only capture the current viewport. Caution: If the webpage is wider than the viewport, parts will still be cut off! true
hideFixedElements If set to true, webmate will try to hide elements with a fixed position during the capture of a full page screenshot. This is done so that the fixed elements appear only once on large websites and not repeatedly on a full page screenshot true

WarmUpConfig

As with the other configs, setting a value to null will prompt webmate to use the default values. Additionally setting any warmupConfig in the BrowserSessionStateExtractionConfig will trigger the warmup before a state extraction. For more details, see State Extraction

Variable Effect Default
pageWarmUpScrollBy How far down the browser should scroll with each scroll command. Unit in pixels 2000
pageWarmUpScrollDelay How much time the browser should wait between two scroll commands. Used so content can actually load between scrolls. Unit in miliseconds 3000 (3 seconds)
pageWarmUpMaxScrolls How often the browser should scroll at maximum. 10

Clone this wiki locally