Joe Biden was asked if he thinks
$$.as is a killer feature. «Mmm hmm, I do», — Biden answered.
We added operations with clipboard
assertEquals("Hello World", Selenide.clipboard().getText());
Note that clipboard doesn’t work on Linux without graphical environment.
headless mode for Microsoft Edge
Configuration.headless worked only for Chrome and Firefox, now it also works for Edge.
(Browsers IE, Opera and Safari afaik still don’t support headless mode)
We added method $$.as() for giving collection an alias
As you probably remember, we added method
$.as() in Selenide 5.17.0. It allows to give an alias (human-readable name) to any
Now you can also given readable names to collections:
$(By.xpath("/long/ugly/xpath")).as("Login button").shouldBe(visible); $$(By.xpath("/long/ugly/xpath")).as("Login buttons").shouldHave(size(2));
NB! Don’t rush with using this feature. I personally take it as a “last sort hack”.
It’s always better to see the real locator instead of a name which always may happen to be:
It’s always better to invest your time in readable locator, method names, well-organized tests etc. This is where the real power lies.
We added collection condition
$$.shouldHave(texts("a", "b", "c")) checks that the collection contains exactly these elements, and not any others.
But sometimes we want a less strict check. For example, you need to check that the traded currencies list contains EUR and USD - and any others.
Now we have a method for such check:
UPD In release Selenide 5.20.1 it was renamed to
$$.should(containExactTextsCaseSensitive("RUB", "EUR", "USD"));
Fixed the lost FirefoxOptions
In some situations some of Firefox options could be lost. Now they are not lost anymore.
Removed duplicate logging of “navigation” methods
SelenideElement has several methods to find other elements:
Such methods were logged twice: first when you call them, and second when you call another method of the the found element. Now we removed this duplication.