Selenide 6.1.1: Capabilitities

1,234 views
Skip to first unread message

Andrei Solntsev

unread,
Nov 26, 2021, 2:30:08 PM11/26/21
to selenide

TERE HOMMIKUST!


We released Selenide 6.1.1.

In this tiny release we fixed a bunch of problems with browser settings.
These problems arose after upgrading to Selenium 4 where ChromeOptions and other Capabilities were refactored.

Now we Ну вот, now we plunged into the topic and fixed all the problems at once.


Early conflict detection

If you try to open a Chrome with Firefox settings:

Configuration.browser = "chrome";
Configuration.browserCapabilities.setCapability(FIREFOX_OPTIONS, new FirefoxOptions());

then Selenide 5.x did show a clear error message, but Selenide 6.0.x didn’t.
Now we have restored the swearing, and you will see the old good

IllegalArgumentException: Conflicting browser name: ‘chrome’ vs. ‘firefox’

See issue 1591 and PR 1642.


Merging of chrome arguments

Say, if you want to run Chrome in full screen mode or setup its language:

ChromeOptions options = new ChromeOptions();
options.addArguments("--start-fullscreen", "--start-incognito");
options.setExperimentalOption("prefs", ImmutableMap.of("intl.accept_languages", "de_DE"));
Configuration.browserCapabilities = chromeOptions;
open("https://codeborne.com";)

then these settings were lost in Selenide 6.0.x
Now we have restored them.

See issue 1626issue 1630 and issue 1631.

The fix was in PR 1642.


IMPORTANT

If you used Configuration.browserCapabilities, then with a high probability you wrapped it into DesiredCapabilities:

ChromeOptions options = new ChromeOptions();
options.addArguments(...);

DesiredCapabilities caps = new DesiredCapabilities();
caps.setCapability(ChromeOptions.CAPABILITY, options);
Configuration.browserCapabilities = caps;

Now you have to simplify your code, to avoid loosing of your settings:

ChromeOptions options = new ChromeOptions();
options.addArguments(...);
Configuration.browserCapabilities = options;


We changed the parameter type of WebDriverProvider

… from DesiredCapabilities to just Capabilities.

For you, almost nothing changes. If you use WebDriverProvider in your tests, simply change DesiredCapabilities to Capabilities and everything will work as previously.

See PR 1642.


More capabilities for the Capabilities God!


Andrei Solntsev

selenide.org

Reply all
Reply to author
Forward
0 new messages