Hello, coldies!
We’ve got a new release Selenide 7.13.0, let’s start the unboxing!
proxy.cleanupFilters()Selenide has method $.download() that downloads a file in browser and returns this file. It’s useful for testing all kinds of reports, excel, pdf files etc.
This is a highly non-trivial operation in itself. Selenide implements several algorithms under the hood (HTTPGET, PROXY, FOLDER, CDP), each with its own pros and cons. Not all of them, for example, work with a remote browser.
So, the FOLDER method hasn’t worked well with Selenium Grid up until now, especially when the file being downloaded is large (say, over 100 MB). There was also no reliable way to wait for the download to complete.
Things got much better now:
I tried downloading files up to 4 gigabytes from the grid – it flew off the server like a cannonball. :)
See PR 3207.
Another improvement for downloading large files. For such files, it’s reasonable to set a long timeout but a small “increment timeout”:
File pdf = $("#report").download(using(FOLDER)
.withTimeout(ofMinutes(10))
.withIncrementTimeout(ofSeconds(5))
.withName("report.pdf"));
In this case, the overall download timeout is 10 minutes, BUT if there are no changes in the download folder within 5 seconds, the method will immediately throw an error.
So, if the #report link wasn’t found at all, the method would wait for 10 minutes. That’s still too long if the locator was simply wrong. Now it will fail after 5 seconds.
See issue 3175 and PR 3212.
Getting back to the clouds. Selenide makes it easy to run a browser not only locally, but also “remotely,” i.e., on another machine. On Selenium Grid, BrowserStack, LambdaTest, Saucelabs, Selenoid, Moon, etc.
To do this, you just need to set the remote setting:
Configuration.remote = "https://your-cloud-provider.com/wd/hub";
Sometimes these clouds require authentication, and then the username-password can be written directly into the URL:
Configuration.remote = "https://username:pass...@your-cloud-provider.com/wd/hub";
The problem is that Selenide was writing this URL to the logs, exposing the credentials.
Now it will mask it:
23:00:10:763 [main] DEBUG WebDriverFactory - Creating webdriver in thread 1:
browser=chrome, browser.version=null, browser.size=1200x960,
remote=http://***:***@localhost:43008/wd/hub
See issue 3210 and PR 3213.
proxy.cleanupFilters()This is convenient for removing any custom filters added by your tests. It was already possible with methods proxy.removeRequestFilter(name) and proxy.removeResponseFilter(name), but now they can be removed more easily, without worrying about names. Simply at the end of each test:
@AfterEach final void done() {
getSelenideProxy().cleanupFilters();
}
See issue 3211 and PR 3215.
When you enable Selenide proxy, among other things, it monitors the size of the server requests or responses, and issues warnings if the size exceeds 2 MB. In the beginning, it seemed like a good idea, but now we’ve decided that it is not Selenide’s responsibility. You probably have more suitable monitoring and optimization tools. And our proxy will work more efficiently without them.
If you really liked these warnings, you can add exactly the same filters to the proxy yourself, in your own tests.
See PR 3215.
Selenide has a built-in proxy server that listens to traffic between the browser and the server, allowing you to do all sorts of interesting things with tests. Download files, bypass authentication, spoof server responses, and so on.
To do this, you can add your own filters to the proxy, each with its own unique name (so you can delete them later). Selenide has several filters, which we don’t recommend deleting.
Now they will all have the same prefix “selenide.proxy.filter.”, so you won’t confuse them with your own.
See issue 3211 and PR 3215.
Selenide has its own video recorder, in which we recently found a tiny problem. It happened when you requested a high FPS, but had a slow browser.
For example, if you want to generate video with FPS=30, but the browser is slow enough, and can take only 10 screenshots per second, then the final video was 3 times faster than the reality. :)
The video should now be at normal speed.
See issue 3189 and PR 3197.
Including CDP version update from v142 to v143.
This is a big deal for me personally, as many of my changes made it into this release, and all of them were useful in our release today:
See PR 3202
Well then — is the holiday already knocking on your door?
14.12.25