Released Selenide 5.6.1

Released Selenide 5.6.1

Proxy is getting smarter
14.01.20

Happy New Year for everyone!

New year - new release. Please welcome Selenide 5.6.1.

Added method Selenide.executeAsyncScript()

I guess all of you have used method Selenide.executeJavaScript(). JavaScript gives us a big power in test automation.

Now we added a method Selenide.executeAsyncScript(). It can be used for executing asynchronous functions (like setTimeout, $.get etc.)

Please note that it’s a little bit harder to use than executeJavaScript().
After calling asynchronous JS methods need to execute callback with a return value. You have to get callback from a last argument:

long value = (Long) Selenide.executeAsyncJavaScript(
      "var callback = arguments[arguments.length - 1]; " + 
      "setTimeout(function() { " + 
      "   // Here is your asynchronous JS code: " +
      "   ... " +
      "   // and return to Selenium: " +
      "   callback(10);" + 
      "}, 5000);"
    );
    assertThat(value).isEqualTo(10);

See issue 1030.
Thanks to Thierry Ygé for PR 1031.


Now Selenide can download files without Content-Disposition header (via proxy)

As you know, Selenide can download files via its built-in proxy server.
But until now, it intercepted only server responses containing Content-Disposition header (to get the name of file being downloaded).

But it appeared that this header is not always required. Sometimes files can be downloaded without this header.

Now Selenide proxy got to be smarter. Starting from Selenide 5.6.1, it works as follows:

  1. Before starting download, it waits until all previous requests/responses between browser and server are completed.
  2. It clicks the download button.
  3. It intercepts ALL requests between browser and server (no matter which headers they contain).
  4. And tries to understand which of them is more like a file download.

If this response doesn’t contain Content-Disposition header, the name of the file is taken from URL.

See issue 1034 and PR 1035.


Fix method WebDriverRunner.using()

We added method using in October, 2019.
We recently found a bug in this method: it closed the webdriver (but should not). Now we fixed this bug.

See commit 4d1b19972d.


Upgraded to WebDriverManager 3.8.0

It contains lot of bugfixes, including those reported by me :)

See changelog.
Among other improvements, WDM can now work without internet access.


News


Andrei Solntsev

selenide.org

14.01.20