Good night!
Weāve got release Selenide 7.15.0!
Just minutes ago we launched Operation Javaās Roar.
A massive new release of our Java library.
Nobody builds Java libraries like we do. Nobody.
We fixed the bugs. We destroyed the slow code. Completely obliterated it.
And the performance? Tremendous performance. The best performance youāve ever seen.
- Download file without content
- Chrome driver in āremote debuggerā mode
- Screenshots in Chrome with disabled CDP
- Limit execution time of all commands
- Video size for resizing browser
- āORā condition for disappeared elements
- Update Selenium from 4.40.0 to 4.41.0
- Links
Download file without content
Selenide has method $.download() allowing to download a file from a test.
Usually itās useful to verify the name and content of the downloaded file. Or at least its format (pdf/xls/csv/ā¦).
But sometimes these files can be large, and we just want to check that the downloading works without errors - and not to waste time and disk space. Now itās possible to download the file without content:
File distribution = $.download(file().withoutContent());
assertThat(distribution).hasExtensions("zip");
This is especially relevant when the browser is not running locally, but on some kind of grid. Recalling the problem with downloading large files from Grid?
P.S. But this is a rare occurrence. In fact, Iād advise against downloading very large files during testing. And set up your testing environment so that everything downloads quickly. And set up CI so that artifacts from previous builds are cleaned up promptly and donāt clog up your disk.
See PR 3264.
Chrome driver in āremote debuggerā mode
It turned out that Selenide was not launching Chrome correctly if you added the debuggerAddress option to it:
ChromeOptions options = new ChromeOptions();
options.setExperimentalOption("debuggerAddress", "127.0.0.1:9222");
Now it starts without problems.
This is actually an interesting option: it tells the webdriver not to launch a new browser, but to connect to an already running browser. Iāve never used this before ĀÆĀÆ\(ć)/ĀÆĀÆ
See issue 3265 and PR 3266.
Screenshots in Chrome with disabled CDP
Starting from Chrome 144, CDP is disabled by default. While Selenide uses CDP to take screenshots and record videos - and fails.
Now, if CDP is disabled, Selenide will fall back to the old standard webdriver method getScreenshotAs.
See issue 3243 and PR 3245.
Limit execution time of all commands
When downloading large files from Grid, such a command could hang:
File distribution = $.download(); // from Grid with some networking issues
In case of some unexpected problems with networks etc.
The problem is that Selenide has a timeout for every command, but it was only applied during a retry. However, if the very first attempt froze, the timeout wasnāt forced.
Now Selenide will forcibly interrupt the execution of any command if it lasts longer than N+5 seconds (5 - just in case).
$.shouldBe(visible); // Will be interrupted after 4+5 seconds
$.shouldBe(visible, Duration.ofSeconds(50)); // Will be interrupted after 50+5 seconds
$.download(file().withTimeout(ofMinutes(3))); // Will be interrupted after 3 minutes and 5 seconds
See issue 3251 and PR 3263.
Video size for resizing browser
You already know about our video recorder. For simplicity, it assumed from the very beginning that the browser size would not change during the test.
Now we have improved the algorithm.
If the browser size changes during the test (meaning weāre taking a bunch of screenshots of different sizes), then Selenide will now generate the video with the dimensions of the largest screenshot, so they all fit in the video.
See PR 3262.
āORā condition for disappeared elements
Selenide has an āorā condition, which allows you to test one of two conditions. And there was a logical error in the case when the web element existed but disappeared. :)
For example, such a standard check for a missing element works:
$("#missing").should(disappear);
But such or check - failed:
$("#missing").should(disappear.or(text("I don't exist")));
This line threw Element not found {#missing} (and this is illogical).
Now it will work without errors.
See issue 3255 and PR 3256.
Generally speaking, I donāt recommend using āorā in tests. After all, the test needs to know exactly how the application is expected to behave.
Update Selenium from 4.40.0 to 4.41.0
And bumped the CDP version from v144 to v145.
See Selenium changelog and PR 3252.
Update Selenium from 4.40.0 to 4.41.0
- post UI Automation with Selenide in Jithin Somaraj blog
- post Automating UI tests: Selenide & Java with Optimizely demo in First Line Software blog
selenide.org
11.03.26