Released Selenide 5.21.0

an anniversary release

Blog

Released Selenide 5.21.0

Say no to duplicates!

Good evening!

We have released Selenide 5.21.0.

What’s new there?


We removed duplicate screenshots for chained locators

Most of Selenide methods are chainable (aka fluent), so that you can call multiple methods in a line. Thus way you can write concise tests.

Something like

  $("table#id").$("tbody", 2).$("tr.active").$("td", 5)
    .shouldHave(text("Ну вот"))
    .click();

But there has been a problem with chained calls. If such a check failed, Selenide took multiple screenshots and added multiple steps to the report (incl. Allure report). One screenshot for "table#id", another for "tbody" etc.
Though it’s essentially a single step.

Though it was not critical, we have fixed this unpleasantness. Now Selenide will take one screenshot, and Allure report will contain one line.

See issue 1055 and PR 1465.

NB! We had to do quite a major refactoring, so something might go wrong. Feel free to share your feedback, let’s fix it quickly!


We added BrowserPerTestStrategyExtension

… for reopening a browser on every test.

By default Selenide reuses browser between tests (in a single thread). It’s a good idea for performance: opening a new browser takes time.
We assume you take care of the AUT state: clear cache, reset data, reload a page etc. in the beginning of every test. The exact clearing logic depends on your application anyway.

But if you really want to open a new browser in every test, Selenide provides built-in mechanism for JUnit 4, JUnit 5 and TestNG.

But we recently realized one missing feature for JUnit5. Selenide had only an extension for re-opening a browser before every test class (@ExtendWith({BrowserStrategyExtension.class}), but not test method.

Now we added such an extension. If you add @ExtendWith({BrowserPerTestStrategyExtension.class}, Selenide will open a new browser before every test method.

Don’t forget it makes your tests slower!

See issue 1448 Thanks to Anton Aftakhov for PR 1450.


We added method $.hover() with offset

Selenide has method $("div#123").hover() for emulating moving cursor onto given element. But this method puts cursor in the center point of the element, and you could not influence that.

Now we have overloaded method $.hover() with offset parameter. It allows you to specify how many pixels for the center point should be the cursor located:

  $("div#123").hover(withOffset(123, 122));

P.S. It seems the offset does not always work precisely. In my tests, it was located near this position plus-minus 30 pixels. Feel free to share your experience with hover!

See issue 1447 and PR 1461.


Upgraded to WebDriverManager 4.4.3

Thanks to Anil Kumar Reddy Gaddam for PR 1464 and PR 1469.


Updated javadoc of many Selenide methods

… regarding lazy loading and “not recommended” phrase.

Now javadoc has links to these wiki articles:

You will probably want to discuss these topics. Great, let’s discuss them!

See PR 1430


selenide-selenoid 1.1.2

We released update selenide-selenoid:1.1.2 with support for BasicAuth when downloading files from Selenoid containers.
See issue 8 and PR 9.


selenide-appium 1.6.5

We released update selenide-appium:1.6.5 with improved error message in iOS tests.
See issue 54.


Links

Here are some links about Selenide we recently found:


Statistics

It’s a Selenide download statistics for April, 2021:

We almost achieved 200 K downloads per months!



Andrei Solntsev

selenide.org

The project is maintained by