You can use client properties feature to easily set the driver and browser configurations. When you create a new session by using SessionManager, you can simply pass the path to your client properties file to instantiate your session with the desired configurations:
ExtWebDriver ewd = SessionManager.getInstance().getNewSession("client", "client.properties");
SessionManager will automatically use the appropriate configuration properties to setup your session. There are many different options you can use with client properties. Please refer to the following table for available configurations:
Category | Property Name | Default Value | Description |
---|---|---|---|
Browser | browser | HtmlUnit | - IE, Firefox, Chrome, HtmlUnit, Safari
- Available browsers on Sauce Labs (e.g. Android, iPad, iPhone, Opera) |
Browser | browser.version | Version of the browser. Required for IE and optional for other browsers when running locally. *Required for running on Sauce Labs |
|
Browser | browser.init.position.x | 0 | Horizontal position to set browser location. Useful for debugging tests. |
Browser | browser.init.position.y | 0 | Vertical position to set browser location. Useful for debugging tests. |
Browser | download.folder | Default folder to download files from browser | |
Browser | download.time | 18000 | Maximum browser download time in milliseconds |
Browser | upload.folder | Default folder to get files to upload on browser | |
Browser | proxy | HTTP proxy setting (e.g. localhost:8080) | |
Browser | proxyHttps | HTTPS proxy setting (e.g. localhost:8080) | |
Driver | appearWaitTime | 5000 | Maximum time to wait for an element to appear in milliseconds |
Driver | binaryPath | Only required when using Firefox as browser. Path to firefox.exe executable. | |
Driver | debugMode | false | Turns on debug mode. Highlight will automatically turn on when this is set to true. |
Driver | firefoxProfile.extension.# | Path to the Firefox extension. This will load the extension when the browser session is created. You can set multiple extensions by including "firefoxProfile.extension.1", "firefoxProfile.extension.2", etc. You must use "binaryPath" together to use this property. | |
Driver | firefoxProfile.file | Path to the configuration file containing Firefox profile settings. You must use "binaryPath" together to use this property. | |
Driver | firefoxProfile.folder | Path to the custom Firefox profile to use. You must use "binaryPath" together to use this property. | |
Driver | highlight | false | Highlights web elements during execution. Useful for debugging |
Driver | highlight.FIND | rgb(255,255,0) | Highlight color for when locating elements. Only works when hightlight is set to true. |
Driver | highlight.GET | rgb(135,206,250) | Highlight color when getting value from elements. Only works when hightlight is set to true. |
Driver | highlight.PUT | rgb(152,251,152) | Highlight color for setting value on elements. Only works when hightlight is set to true. |
Driver | maxAllowedSessions | Maximum number of sessions which can be created by SessionManager. Leave it empty for unlimited sessions. | |
Driver | maxRequestTimeout | 18000 | Maximum WebDriver request timeout in milliseconds |
Driver | numberOfDaysToKeepTempFolders | 7 | Period of time to keep temporary WebDriver folders created in temp directory |
Driver | selectLastFrame | true | Automatically select the last iframe used so that you don't have to explicitly call switch frame everytime. |
Driver | tempFolderNameContainsList | Comma separated list of folders to clean within WebDriver temporary files | |
Driver | webdriver.ie.driver | Path to IEDriversServer.exe. This is not necessary if you add path to IEDriverServer.exe to your system library path. | |
Driver | webdriver.chrome.driver | Path to chromedriver.exe. This is not necessary if you add path to chromedriver.exe to your library path. | |
Driver | webdriver.doTaskKill | true | Gracefully kills all the driver server processes at the beginning of execution. Not recommended when running tests in multithreaded mode. |
Operating System | os | Name of the operating system running against such as 'Windows' | |
Operating System | os.version | Version of the operating system running against such as '7' for Windows | |
Selenium Grid | grid.platform | Windows 7 | Operating system to run against on Selenium Grid. Please refer to https://saucelabs.com/docs/platforms. *Required for running on Sauce Labs |
Selenium Grid | grid.properties | record-screenshots=true | Space separated properties for running on Selenium Grid. Refer to Selenium Grid properties for supported configurations. |
Selenium Grid | grid.url | URL for the Selenium Grid server. Sauce Labs Example: http://sauceUserName:accessKey@ondemand.saucelabs.com:80/wd/hub *Required for running on Sauce Labs |
|
Selenium Grid | useGrid | false | Turn on to use Selenium Grid instead of local machine. *Required for running on Sauce Labs |