javaseleniumselenium-webdriverjunitselenium-jupiter

What would be the best approach to overwrite multiple SeleniumJupiter configuration parameters?


As part of my test base class, I have something like this:

seleniumJupiter.getConfig().setDefaultBrowser(BROWSER.getStringValue());
seleniumJupiter.getConfig().setScreenshotAtTheEndOfTests("whenfailure");
SeleniumJupiter.getConfig().takeScreenshotAsBase64AndPng();

and potentially 10-20 more config parameters. Could I somehow overwrite the whole selenium-jupiter.properties file and change some of the properties and other left default?


Solution

  • You can maintain your own copy of selenium-jupiter.properties in your project classpath, changing the values you need, and leaving the default values for the others. Then, you have two options to configure Selenium-Jupiter to use that properties:

    1. Using a JVM property: -Dsel.jup.properties=/my-sel-jup.properties

    2. Using an environmental variable: SEL_JUP_PROPERTIES=/my-sel-jup.properties