Released Selenide 5.19.0

Released Selenide 5.19.0

Independence day
24.02.21

Good morning!

You probably didn’t know, but today, February 24, is the main holiday in Estonia - Independence Day. Exactly 103 years ago, Estonia was proclaimed an independent democratic republic.

And 93 years later in Estonia, in the casemates of Codeborne company, Selenide library was born. Isn’t that a miracle?

So we dedicate our new release Selenide 5.19.0 to Independence Day.


We fixed drag’and’drop, finally!

Selenide has had method $.dragAndDropTo() for years, but de-factor it doesn’t work. Under the hood it uses Selenium mechanism Actions, and something was broken in it. It just doesn’t drag the element.

Now we added an alternative implementation using tricky JavaScript snippet. And it seems to work in all browsers. We even made it the default implementation.


// The working solution:
$("#drag1").dragAndDropTo("#div2");
$("#drag1").dragAndDropTo("#div2", usingJavaScript());

// Non-working solution using Actions (in case if you still want to give it a chance):
$("#drag1").dragAndDropTo("#div2", usingActions());

See issue 1110.

Thanks to Dmitriy Budim for PR 1412.


Appium support

We also released a selenide-appium:1.6.2 update which has method $.dragAndDropTo() overridden, so that it works on mobile devices too. See PR #53.


We fixed method $.click(usingJavascript()) in Internet Explorer

See issue 1406 and PR 1419.


We improved description of $$.snapshot() collections

There is one tricky method in Selenide collections: $$.snapshot().
It takes a “snapshot” of the collection (fetches its elements only once), and doesn’t reload them from browser anymore. It may be useful to speed up your tests in case of big collections. But only if you are sure that the collection elements will not change anymore.

There was one tiny problem: such a snapshot didn’t look nice in reports. For example, this line:

$$("#root li").snapshot().shouldHave(size(3))

when failed, looked in the report like this:

List size mismatch: expected: = 3, actual: 2, collection: $$(2 elements)

The description doesn’t contain selector of the original collection, only (2 elements).

Now it also contains the selector:

List size mismatch: expected: = 3, actual: 2, collection: #root li.snapshot(2 elements)

Thanks to Pavel Fokin for PR 1402.


Added method $.getAlias()

It returns the same value that you set with method $.as("login button").
Normally you don’t need this method. But it may ne useful for those who generate their own reports. Who knows, probably some of you is developing an Allure killer…

Thanks to pavelpp for PR 1415.


Added “refresh” and other events to Selenide log

There is a bunch of method in Selenide that are not related to web elements (like refresh(), back() etc.) And we recently found that some of these methods were not shown in Selenide/Allure reports. Not fatal, of course, but still, someone needs these reports for some reason…

Now we fixed it, and the following actions will be added to reports:

  • refresh
  • back
  • forward
  • updateHash
  • confirm
  • dismiss
  • prompt
  • clearCookies

See issue 1383 and PR 1404.


Added @Nullable annotations to WebDriverRunner methods

Probably the most import is @Nullable annotation for method WebDriverRunner.getSelenideProxy(): it was not obvious that this method can return null if the proxy is not started.

Now such an error will be highlighted in your IDE.

See commit.


Fixed Selenide own tests on non-EN machines

Selenide user @vrossellotravelc tried to build selenide project on a machine which has a default language other than English (was it French or Spanish?)

We found that a couple of Selenide own tests contained hard-coded formatting of Duration, which can differ in other locales.

Now those tests are fixed so that it cannot happen anymore. How? Welcome to the PR!

Thanks to Vicente Rossello Jaume for PR 1408.


Statistics

The latest Selenide downloads statistics:


Traditions

That’s it for today.

While you are updating, I’m going to find a glass of vodka and a sprat sandwich.
It’s a tradition in Estonia for independence day, you know.


Andrei Solntsev

selenide.org

24.02.21