Released Selenide 6.0.1

Capabilitities

Blog

Released Selenide 6.0.1

We got 10 years old!


Happy Birthday, Selenide!

Wow! It’s hard to believe, but today Selenide got … 10 years old!

This day 10 years ago was created the first commit to Selenide github repository.

Many thanks to everyone who participated in the project, committed, reported bugs, suggested ideas, answered questions in the forums, criticized and talked about selenide at conferences and meetups. And who just decided to use Selenide in their projects. You are all part of this movement.


In honor of the anniversary, we released major version Selenide 6.0.1.


Upgraded to Selenium Webdriver 4.0.0

Nothing really should change for you until you are using Selenium Grid. Everything more or less works as before. Well, some classes were renamed or deprecated - it seems not scary.

Selenium 4 also brings new features (like CDP and Relative locators), but haven’t introduced any special support for them yet. Can work on it in next versions if needed.

See issue 1162, PR 1605, PR 1614 and PR 1617.


Splitted Selenide to several artifacts

Before now, the whole Selenide code was published as a single artifact: selenide-5.25.0.jar.
And you had to add other dependencies like JUnit or TestNG, and probably BrowserMobProxy.

Now we made it easier for you (especially with proxy).

  1. For JUnit5 users the dependency will not change:
    testImplementation("com.codeborne:selenide:6.0.1)
  2. JUnit4 users should use
    testImplementation("com.codeborne:selenide-junit4:6.0.1)
  3. TestNG users should use
    testImplementation("com.codeborne:selenide-testng:6.0.1)
  4. If you want to use proxy, it’s enough to add dependency
    testImplementation("com.codeborne:selenide-proxy:6.0.1) - and forget about all these BrowserUpProxy, Netty etc.
  5. And if you happen to be a radical hater of static methods, now you can also be happy by declaring
    testImplementation("com.codeborne:selenide-core:6.0.1) - and then you will only have SelenideDriver without Selenide.* static methods.

See PR 1612.


Removed lots of deprecated code

Here you can find what exactly was removed and how can you replaced it.
In particular,

  • ElementsCollection.shouldHaveSize() -> ElementsCollection.shouldHave(size())
  • $.waitUntil(_, timeout) -> $.should(_, Duration.ofMillis(timeout))
  • $.waitWhile(_, timeout) -> $.shouldNot(_, Duration.ofMillis(timeout))
  • Condition.disappears -> Condition.hidden
  • Condition.matchesText -> Condition.matchText
  • Selenide.close -> Selenide.closeWebDriver() or Selenide.closeWindow()

Thanks to Boris Osipov for PR 1607 and PR 1609.


Remove support for browser “legacy_firefox”

It was an old webdriver that worked with Firefox 52 and earlier. I guess it’s not used anymore.

See PR 1610.


Removed some old settings

Configuration.startMaximized

We think this is bad practice, because the size of the browser window depends on the current environment, which can lead to flaky tests. We recommend to use Configuration.browserSize instead (default value is 1366x768).

Configuration.versatileSetValue

Most probably you didn’t use it because it was false by default.
Now for selecting a value from <select> or <input type=radio> you can use plain old methods $.selectOptionByValue() and $.selectRadio().

Thanks to Boris Osipov for PR 1619.


Fixed method Selenide.sleep(N)

It turns out that the standard Java method Thread.sleep (N) does not necessarily sleep exactly N ms, it can wake up earlier. And this can cause flaky tests if your expected a certain pause.

Now method Selenide.sleep(N) is guaranteed to wait at least given number of milliseconds.

See implementation.


Added methods for adding/removing WebDriverListener

Selenide has method for adding WebDriverEventListener, but this class was replaced by WebDriverListener in Selenium 4.
So we have to support both.


See issue 1615 and PR 1616.


Changed signature of method Condition.apply

It doesn’t concern you until you created your custom Conditions.

Before now, class Condition had method apply which returned boolean:

public boolean apply(Driver driver, WebElement element) 

Now you need to rename it to check and return CheckResult instead of boolean:

public CheckResult check(Driver driver, WebElement element) 

This CheckResult contains not only flag “condition met / not met”, but also a actual value at that moment.
It allows Selenide to generate a better error message in case of test failure.

P.S. Though, old method apply is not removed, but just marked as deprecated. So you can postpone this refactoring for some time.

See issue 217, PR 1586 and PR 1618.


selenide-selenoid 2.0.1

We released selenide-selenoid:2.0.1 with upgrade to Selenide 6.0.1


selenide-appium

It seems that Appium doesn’t support Selenium 4 yet, so we cannot upgrade selenide-appium yet. Stay tuned.


UPD Selenide 6.0.2

We found a problem with projects using TestNG, released a hotfix 6.0.2.

See issue 1623


UPD Selenide 6.0.3

It appears that Maven can fetch an older version of selenium-api-3*.jar if it’s found in a dependency tree (usually in BrowserUpProxy or Allure transitive dependencies).

I personally find this Maven behaviour misleading and just wrong. Maven could pick up a newer version.
But since people often experience this problem, we decided to add a workaround on Selenide side.

See workaround 1625


What to read about Selenium 4


Other news


Selenide download statistics


We crossed 255K downloads per months!

What is waiting us in next 10 years?


Andrei Solntsev

selenide.org

The project is maintained by