Skip to content

Neodymium configuration properties

Marcel Pfotenhauer edited this page Aug 7, 2018 · 19 revisions

Configuration via properties files

Neodymium combines a couple of frameworks that all have their own configuration needs which also effects test execution. Most of these properties can be defined/overwritten with environment variables. However since this is an awkward way of configuration we introduced the file: config/neodymium.properties The file contains a collection of properties that is used to configure some aspects of the used frameworks. It doesn't cover all of the possible configurations for all the frameworks we've integrated. Have a look at this file since it lists all supported properties as well as their default values and its purpose. We use Owner a framework to write powerful and flexible properties without in order to avoid writing all the boilerplate code. If you are in need of your own set of global properties we encourage you to give Owner a try.

Neodymium properties

The following properties can be configured in the config/neodymium.properties file. Those properties can be accessed via Neodymium.configuration().[propertyGetterMethod]().

Url properties

Property Default value Description
neodymium.url <none> The URL of the web site to test
neodymium.url.protocol <none> The protocol used to access the site
neodymium.url.host <none> The host encoded in the URL
neodymium.url.path / The path on the site that is used as test entry point
neodymium.url.site <none> The site/channel part of the url

Localization

Property Default value Description
neodymium.locale en_US The locale that should be used to lookup translations in localization feature
neodymium.localization.file config/localization.yaml Path to the YAML formatted file that contains localized (translated) data for the site

Basic authentication properties

Property Description
neodymium.basicauth.username Username that should be used for basic authentification
neodymium.basicauth.password Password that should be used for basic authentification

Selenide properties

Property Default value Description
neodymium.selenide.timeout 3000 (ms) How long should Selenide wait to match a condition

Debugging properties

Property Default value Description
neodymium.debugUtils.highlight false Should elements highlighted that are selected by Selenide
neodymium.debugUtils.highlight.duration 100 (ms) How long should an element be highlighted
neodymium.junit.viewmode tree How to display test execution in Eclipse JUnit view. tree - a hierarchical representation, flat - a flat list of tests

Neodymium context properties

Responsive design breakpoints. Determines at which page width a site is considered to be displayed on a small, medium, large oder extra large device.

Property Default value Description
neodymium.context.device.breakpoint.small 544 (pixel) Maximum browser width for small devices (0 - 544)
neodymium.context.device.breakpoint.medium 769 (pixel) Maximum browser width for medium devices (545 - 769)
neodymium.context.device.breakpoint.large 992 (pixel) Maximum browser width for large devices (770 - 992)
neodymium.context.device.breakpoint.xlarge 1200 (pixel) Maximum browser width for extra large devices (993 - 1200)

JavaScriptUtils properties

Property Default value Description
neodymium.javaScriptUtils.timeout 2000 (ms) The amount of time to wait until JavaScript is considered to finished execution. Used by "until" function of JavaScriptUtils.
neodymium.javaScriptUtils.pollingInterval 200 The interval at which "until" function checks whether conditions are fulfilled.
neodymium.javaScriptUtils.jQueryIsRequired true Indicates that jQuery must be on the page and available in order to count the site as loaded.
neodymium.javaScriptUtils.loading.animationSelector Designed to select a loading animation to indicate if site loading has finished or not.

Proxy configuration properties

HTTP proxy settings. Specify host and port of the proxy server and whether it should be used at all. If the proxy requires user authentication, make sure to provide the credentials needed. You may also configure a comma separated list of hosts that can be used directly, thus bypassing the proxy. Note that the host definitions are interpreted as regular expressions so ensure proper use of escape characters. Beside the config/neodymium.properties file the proxy configuration can be also be configured within a config/proxy.properties file. In case you need a separate file for CI environments.

Property Description
neodymium.proxy Decide whether or not a proxy is used (Default: false)
neodymium.proxy.host The host of the proxy
neodymium.proxy.port The host of the proxy
neodymium.proxy.bypassForHosts The host of the proxy
neodymium.proxy.socket.userName The socket username of the proxy
neodymium.proxy.socket.password The socket password of the proxy
neodymium.proxy.socket.version The socket version of the proxy

Credentials properties

Since we support plattforms like SauceLabs and BrowserStack there is a need to store credentials to access their service. In order to use these service you need to provide an URL as well as credentials to access. Both platforms use Selenium Grid protocol which is used to remote control a web browser in the cloud. You can also setup your own browser cloud with Selenium Grid.

Look at the credentials template. It's designed for accessing only browser automation services which usually use an URL, username and a password respective access key. These credentials are needed to access the services that allow you to use remote browser to execute your tests. SauceLabs usually doesn't use a password. They use an access key which is different from your password and which can be accessed through their web site. So keep that in mind if you want to use such services.

In the example below there is an Firefox configuration that references the SauceLabs account from credentials file. The connection is made by the key pattern of the credentials file. browserprofile.testEnvironment.saucelabs.* defines a test environment named saucelabs which can be referenced in the browser settings as a testEnvironment. That actually means that in order to create that particular web driver defined in browser.properties the information from credentials.properties will be taken into account. Note: There is only a credentials.properties.template file which needs to be renamed to credentials.properties

config/credentials.properties

## Sauce Labs Credentials
browserprofile.testEnvironment.saucelabs.url = https://ondemand.saucelabs.com:443/wd/hub
browserprofile.testEnvironment.saucelabs.username = MyAccount 
browserprofile.testEnvironment.saucelabs.password = secret

config/browser.properties

browserprofile.FF_1024x768.name = Firefox
browserprofile.FF_1024x768.browser = firefox
browserprofile.FF_1024x768.browserResolution = 1024x768
browserprofile.FF_1024x768.testEnvironment = saucelabs
Clone this wiki locally