It was the third day of quarantine.
To make you feel not so lonely, we released Selenide 5.10.0 with a bunch of improvements. Some of them are even slightly backward incompatible. Well, so you do not get bored in your dens.
- Added support for Shadow DOM
- Don’t fetch BrowserUpProxy by default
- Replace Guava APIs by Java APIs
- Made Selenide Allure report nicer
- Added condition shouldBe(image)
We added support for Shadow DOM
See examples in tests:
$(shadowCss("#anyButton", "#shadow-host")).click(); $(shadowCss("p", "#shadow-host")).shouldHave(text("Inside Shadow-DOM")); $(shadowCss("p", "#shadow-host", "#inner-shadow-host")).shouldHave(text("The Shadow-DOM inside another shadow tree"));
val("text") on an input field will result in an error, saying that the element is “not reachable by keyboard”.
Temporary workaround for now is to use
Configuration.fastSetValue = true; $(shadowCss("input", "#shadow-host")).setValue("test");
Selenide does not fetch BrowserUpProxy by default
Taking those two facts into account:
- Selenide fetches BrowserUpProxy and all its transitive dependencies - it’s about ~17MB in total.
- Most of Selenide users (I guess) do not use Selenide proxy.
we decided to avoid fetching those 17 megabytes by default.
Those of you who wants to use proxy just need to add a dependency to your project:
(many of you already have it anyway).
Don’t worry if you forget to add the dependency - you will see a clear error message like this:
java.lang.IllegalStateException: Cannot initialize proxy. Probably you should add BrowserUpProxy dependency to your project. at com.codeborne.selenide.drivercommands.CreateDriverCommand.createDriver(CreateDriverCommand.java:44) ... at com.codeborne.selenide.Selenide.open(Selenide.java:41) caused by: java.lang.NoClassDefFoundError: com/browserup/bup/BrowserUpProxy
Nowadays we don’t need to add that dependency anymore. Just use
com.codeborne:selenide-proxy instead of
It will add all needed dependencies automatically.
Just in case
Probably you feel curious who eats those 17 megabytes? Here they are.
This is the list of files that should disappear from your project. The list is impressive, right?
Migrated Guava API to corresponding Java API
We just changed
java.util.function.Predicatefrom Java 8
and removed Guava dependency. It was great (until Java 8 was released), rip.
If you occasionally implemented your own
CollectionCondition, you will need to rename
test. It must be easy.
We made Selenide Allure report a little nicer
We actually just added quotes around selectors in the Allure report.
Now you can copy selectors from the report and paste into browser’s developer console (though, I cannot imagine why somebody should do it).
We added condition
You can use it to check that image was successfully loaded.
See examples in tests:
$("#valid-image img").shouldBe(image); $("#valid-image").shouldNotBe(image); $("h1").shouldNotBe(image);
We fixed find element by attribute which contains quites
For some reason, people sometimes put quotes inside attributes.
When trying to find an element by such an attribute, Selenide generated an invalid CSS locator.
Now we fixed it.
Did you think that probably SeleniumCamp 2020 is The Last Conference on Earth?
Because of quarantine, they have published all SeleniumCamp 2020 videos.
Among others, this playlist contains my 3 videos (sorry, they are in Russian):
- Flaky tests: The method
- BOF: Glorious past and promising future of Selenide
- Threesome: Selenide for Web, Android and iOS