Released Selenide 5.20.1

Released Selenide 5.20.1

Mmm hmm, a killer feature!
23.03.21

Good night!

Joe Biden was asked if he thinks $$.as is a killer feature. «Mmm hmm, I do», — Biden answered.

This is a double release notes for Selenide 5.20.0 and Selenide 5.20.1.


We added operations with clipboard

  • Selenide.clipboard().setText("111");
  • assertEquals("Hello World", Selenide.clipboard().getText());

Note that clipboard doesn’t work on Linux without graphical environment.

Thanks to Dmitriy Budim for PR 1409.

NB!These methods are overridden in selenide-selenoid plugin to work correctly in Selenoid. We also released version 1.1.0 of the plugin.


We added headless mode for Microsoft Edge

The setting Configuration.headless worked only for Chrome and Firefox, now it also works for Edge.

(Browsers IE, Opera and Safari afaik still don’t support headless mode)

See issue 1422 and PR 1424.


We added method $$.as() for giving collection an alias

As you probably remember, we added method $.as() in Selenide 5.17.0. It allows to give an alias (human-readable name) to any SelenideElement.

Now you can also given readable names to collections:

$(By.xpath("/long/ugly/xpath[1][2][3]")).as("Login button").shouldBe(visible);
$$(By.xpath("/long/ugly/xpath[1][2][3]")).as("Login buttons").shouldHave(size(2));

See issue 1389 and PR 1431.

NB! Don’t rush with using this feature. I personally take it as a “last sort hack”.
It’s always better to see the real locator instead of a name which always may happen to be:

  • Deceiving
  • Deprecated
  • Misleading

It’s always better to invest your time in readable locator, method names, well-organized tests etc. This is where the real power lies.


We added collection condition containExactTextsCaseSensitive

Existing method $$.shouldHave(texts("a", "b", "c")) checks that the collection contains exactly these elements, and not any others. But sometimes we want a less strict check. For example, you need to check that the traded currencies list contains EUR and USD - and any others.

Now we have a method for such check:

  $$.should(containTexts("EUR", "USD"));

Thanks to Oleg Berezhnoy for PR 1426.

UPD In release Selenide 5.20.1 it was renamed to

  $$.should(containExactTextsCaseSensitive("RUB", "EUR", "USD"));

Thanks to Oleg Berezhnoy for PR 1438 and PR 1439.


Fixed the lost FirefoxOptions

In some situations some of Firefox options could be lost. Now they are not lost anymore.

See issue 1436. Thanks to Dmitriy Budim for PR 1437.


Removed duplicate logging of “navigation” methods

SelenideElement has several methods to find other elements:

  • $.findAll()
  • $.parent()
  • $.sibling()
  • $.preceding()
  • $.lastChild()
  • $.closest()

Such methods were logged twice: first when you call them, and second when you call another method of the the found element. Now we removed this duplication.

Thanks to Pavel Fokin for PR 1428.




Andrei Solntsev

selenide.org

23.03.21