Released Selenide 7.14.0

Released Selenide 7.14.0

A tremendous concept of fixing Grid downloads
21.01.26

Good evening!

We’ve got a release Selenide 7.14.0!

Well, we have a concept of a release.

I think it’s going to be a very good release for the Selenide also for you.


Fixed downloading files with space in name

Well, that’s a classic.

Selenide’s $.download() method, which downloads a file in the browser, suddenly didn’t correctly handle spaces in the filename.

How could that be, Anatolych…

So, now such files download perfectly—both locally and from the Grid:

File report = $("#report").download(withExtension("pdf"));

assertThat(report.getName())
  .isEqualTo("Report 0 & _ ' `backticks`.pdf");

See PR 3231.


Fixed a problem with downloading files from the grid that was lagging by 1 second

What a story!

Selenide’s $.download(FOLDER) method worked like this:

  1. Click the button
  2. Wait for a file newer than the time of the click to appear in the folder.

Now imagine the browser is running on a Grid, where the system time is one second behind the current time.

The problem is that in the second step, we compare the time on the test machine with the time on the Grid - and the times can be different. :(

  • Initially, this algorithm was designed only for local execution. And it worked.
  • Then we added a Grid plugin to Selenide. But the algorithm still worked because Grid couldn’t return file modification times.
  • Since Selenium 4.39.0, Grid started returning file modification time, and that’s when our algorithm broke. :)

A big thank you to Mikita Yafimuk for debugging the initial problem. Without you, I would never have realized that it was all about that one second!

See issue 3227 and PR 3240.


increment timeout for grid

Continue with downloading files from grid. :)

Selenide has a special parameter “incrementTimeout” that can be useful when downloading large files. For such files, it’s reasonable to set

  • big timeout (if the file is being downloaded for few minutes), but
  • a small “incrementTimeout” (so as not to wait too long, but to fail faster if there is no progress at all).
File bigReport = $("#slowReport").download(using(FOLDER)
  .withIncrementTimeout(ofSeconds(5L))
  .withTimeout(ofMinutes(5L))
);

And again, this parameter was not used affecting the download process from Grid. For the same reason: grid didn’t return file modification times. Now Grid returns.

Well, Selenide has now learned to take it into account to determine progress.

See issue 3233.
Thanks to Aliaksandr Rasolka for PR 3234.


Forbid removing Selenide own proxy filters

Selenide has a built-in proxy server. It allows you to listen to traffic, log and mock server responses, and more. You can add/remove your own filters for this proxy:

SelenideProxyServer proxy = getSelenideProxy();
proxy.addRequestFilter("proxy-usages.request", () -> ...);
proxy.removeRequestFilter("proxy-usages.request");

But Selenide also has several own filters. And the removeRequestFilter method allowed removing them, which could lead to unpredictable consequences.

It’s no longer allowed:

  proxy.removeResponseFilter("selenide.proxy.filter.download"));

  // throws "The built-in selenide proxy response filter cannot be removed: selenide.proxy.filter.download"

I hope you haven’t done any dirty things like that. ;)

Thanks to Aliaksandr Rasolka for PR 3221.


Now you can remove all proxy request filters (or response filters)

But you can use one method to remove all request filters (or all response filters). This is convenient for cleaning up everything in the end of a test without having to remember which tests added which filters.

@AfterEach void resetProxy() {
  SelenideProxyServer proxy = WebDriverRunner.getSelenideProxy();

  proxy.cleanupRequestFilters(); // All request filters (except Selenide owns)
  proxy.cleanupResponseFilters(); // All response filters (except Selenide owns)

  proxy.cleanupFilters(); // all request and response filters (except Selenide owns)
}

Thanks to Aliaksandr Rasolka for PR 3221.


Mask typed value

Selenide has method type(text("...")). It’s essentially the same as sendKeys(), but with additional options:

  • clear the field before entering,
  • emulate slow input,
  • etc.

Now you can mark the value as “sensitive,” which will mask it in reports and logs:

$("#password").type(text("Secure info"));
$("#password").type(text("Secure info").sensitive());
+----------------+----------------------+-------+-------+
| ...
| #password      | type("Secure info")  | PASS  | 2548  |
| #password      | type("***********")  | PASS  | 2533  |
| ...
+----------------+----------------------+-------+-------+

Thanks to Aliaksandr Rasolka for PR 3226.


Use Video Recorder without Selenide

As you know, Selenide has a killer feature: a video recorder. And now you can connect it to any other Selenium project that doesn’t use Selenide.

It can be very useful for learning flaky tests, creating demos, etc.

Or convincing your colleagues that they urgently need to switch to Selenide. :)

Instructions are in PR 3230.


Compact timeout format in logs and reports

To make the error message easier to read (especially when the timeout appears in the middle of a sentence), we removed the space and period. Now all timeouts in Selenide are written in a unified format:

Before After
Timeout: 2 ms. Timeout: 2ms
incrementTimeout: 1000 incrementTimeout: 1s
Failed to download file in 120000 ms Failed to download file in 120s


See PR 3235.


Upgraded Selenium from 4.39.0 to 4.40.0

And bumped CDP version from v143 to v144.

See PR 3237

And again, this Selenium release has a lot of my changes, so that’s a blast.



It’s a long-term release.
Infinite.
It’s a release that’s forever.


Andrei Solntsev

selenide.org

21.01.26