Released Selenide 5.2.4

Released Selenide 5.2.4

The return of the Proxy

Good evening from the Summer!

While people are celebrating Midsummer Day and Victory Day in Estonia, we are releasing Selenide 5.2.4.

What’s new there?

We fixed proxy on localhost

As you know, Selenide can run its own embedded proxy server for some functions (file downloading, authorization, logging etc.). But last versions of popular browsers (Chrome72+ and Firefox 67+) started denying proxy to intercept requests to localhost (for some security reasons).

That’s why downloading of file got broken for those who run AUT on http://localhost:port (like me).

We had to dig into browser options and add tricky settings which allow proxy to intercept requests to localhost.

See PR 950.

We fixed ScreenShooterExtension for JUnit5

As you know, when Selenide throws an error (as a rule, it’s a subclass of UIAssertionError), it always automatically takes a screenshot. In most cases it should be sufficient, but sometimes people want to use their own asserts (from JUnit, Hamcrest, AssertJ etc). Generally, Selenide cannot take screenshots in these cases - otherwise Selenide would depend on all those frameworks.

But fortunately, Selenide has support for 3 most popular testing frameworks: JUnit4, JUnit5, TestNG.

Recently we found a bug in ScreenShooterExtension for JUnit5. It took screenshots only for Selenide errors UIAssertionError. But should take for NON-selenide errors. So we fixed it.

We improved error message for $$.shouldHave(texts("1", "2", "3"))

Method $$.shouldHave(texts(...)) allows to check texts of the whole collection of web elements. Method $$.shouldHave(texts(...)) allows to check texts of the whole collection of web elements. For example, it’s very convenient for checking a row or a column of a table. But in some (rare) cases it could report correct, but unclear error message. We improved it.

See issue 454.
Thanks to A.Smashentsev for PR 944.

Method $.click(offsetX, offsetY) now calculates coordinates for the CENTER of element

In addition to the “classical” method $.click(), Selenide has similar method $.click(offsetX, offsetY) for clicking with a shift. While “classical” $.click() clicks at the center of element, method $.click(offsetX, offsetY) allows to click at any point of the element.

Here the difference comes: some browsers calculate the shift from center of element, while other - from left top corner. Even Selenium documentation for class org.openqa.selenium.interactions.Actions has a contradiction on this topic:

   * Moves the mouse to an offset from the top-left corner of the element.
  public Actions moveToElement(WebElement target, int xOffset, int yOffset) {
    // Of course, this is the offset from the centre of the element. We have no idea what the width
    // and height are once we execute this method.

Now we officially calculate shift from the center of element.

See PR 950.

We updated dependencies

Some Selenide dependencies got updated:

  • WebDriverManager 3.6.1



Andrei Solntsev