We released Selenide 6.5.0.
Now you can mask passwords in reports
Sometimes you need to type passwords and other sensitive data into input fields. Sometimes people don’t want this data to be visible in test reports (e.g. Allure or TextReport). And ask to hide this sensitive data somehow.
I personally never understood why it’s a problem.
Why the password from test environment should be a problem?
You don’t use the same password in production, right?
You don’t run tests in production, right?
Anyway, we made it possible to mask sensitive data in test reports:
$("#password").setValue(withText("admin").sensitive()); // replaces by "********" $("#username").setValue(withText("john").withDisplayedText("J* username")); // replaces by "J* username"
Now you can easily pick a date in
It’s not a trivial task to pick a date in Selenium.
When your application has element like
<input type=date>, and your test tries to click it, different browsers open
different calendars and use different date formats. In theory, they should use format based on user settings, but in
reality each browser plays its own game.
This causes flaky tests that might work on your machine, but occasionally fail on others.
As a result of my investigation, I found that the only stable way to pick a date is setting a value in format
Now you can easily do it with new method
LocalDate birthday = LocalDate.parse("1979-12-31"); $("#birthday").setValue(withDate(birthday));
$.setValue("") supports React, Vue.js etc.
Standard Selenium method
WebElement.clean() (e.g. it’s used in Selenide method
$.setValue()) doesn’t always work
when the application uses some tricky constructions (generated by React/Vue/…) instead of standard
Hopefully, we have fixed it. Waiting for your feedback.
Now the following 2 methods abandoned using
WebElement.clear(). They use key combinations instead:
input.sendKeys(HOME, chord(SHIFT, END), BACK_SPACE);
input.sendKeys(HOME, chord(SHIFT, END), BACK_SPACE, TAB);
This new way seems to work in all OSs and browsers.
Removed triggering duplicate
As a result of previous change, method
change events only once.
Before this release, method
$.setValue("blah") worked in two steps and therefore triggered events twice:
- Step 1.
- Step 2.
The events triggered on the first step could cause unexpected effects, including disappearing of the field itself.
See issue 960.
blur on a previous element
During working on the previous change, we improved method
$.setValue("blah") so that it triggers
blur event on a
previous active element. At least it helped to fix some of our flaky tests. Hopefully, it can improve your tests as well.
$.append() check that element is not disabled or readonly
Added conditions “interactable” and “editable”
These conditions existed inside of Selenide, but were not available to end-users.
Now you can also use them:
$("input[type=file]").shouldBe(interactable); // interactable = visible OR "opacity: 0" $("input").shouldBe(editable); // editable = interactable AND enabled AND !readonly
$.download(FOLDER) waits for full download completion
Sometimes test might be flaky when it tries to download a file which is being downloaded very slowly. Selenide might
detect and copy the file in
C:\Downloads folder which is not fully downloaded yet.
Now Selenide waits until
C:\Downloads doesn’t contain any files “.crdownload” (for Chrome) or “.part” (for Firefox).
This is a temporary file created by the browser for a short period of time while the file is beging downloaded.
stream() for collections
$$.stream() already existed, but was deprecated in version 6.2.0.
Now you can pick one of two non-deprecated replacements:
Remove Selenium built-in OpenTelemetry
If I am not mistaken, this “telemetry” was added Selenium 4.
I have no idea why it’s needed, but it could interfere with someone who already had their own telemetry.
It was simpler for us to remove it than support both. :)
- Selenium 4.1.3 -> 4.1.4.
- WebDriverManager 5.1.0 -> 5.1.1
- Netty 4.1.75.Final -> 4.1.76.Final
- Netty 4.1.76.Final -> 4.1.77.Final
- LittleProxy 2.0.7 -> 2.0.9
By the way LittleProxy projects moved to a dedicated github organisation, and I became the main maintainer of the project. I was never a big fan of proxies, but LittleProxy is used inside of Selenide, and somebody needs to maintain it…
UPD Selenide 6.5.1
A small update Selenide 6.5.1:
- #1808 Fixed
$.clear()so that it doesn’t press
tabanymore – see PR #1809
- #1806 Bump browserup-proxy-core 2.1.4 to 2.1.5
UPD Selenide 6.5.2