At Black Friday, we released Selenide 5.5.1 with a couple of new features.
We added mobile browser emulation
Sometimes you want to run browser not on a usual Chrome, but on Chrome “like in mobile”.
Like you would open a browser in mobile phone or tablet.
(For example, site selenide.org looks ugly on mobile. :( We are working on it.)
Now it’s easy to do it by adding a System property before running tests:
java -Dchromeoptions.mobileEmulation="deviceName=Nexus 5"
or right in your code:
System.setProperty("chromeoptions.mobileEmulation", "deviceName=Nexus 5");
NB! We are talking only about one setting - a device name. It should be enough in most cases.
If you need to tune other mobile browser settings, please implement
See issue 1008 and PR 1011.
We deprecated method
Selenide always had method
Selenide.close(). But its name is misleading: it closes the whole browser, not only a current window.
The problem is that Selenium Webdriver also has method
close() which only closes a current window/tab (and the whole browser only if it was the only window/tab).
And for closing the whole browser Selenium has method
It was my fault that I created method
close() without reading Selenium documentation. I was young and didn’t believe in Javadoc. :)
But part of the problem is that Selenium names
quit are not intuitive. Go figure which of them closes what.
To make your life easier, we now suggest two method with explicit names:
Selenide.closeWindow()- closes a current window (or tab, which is the same)
Selenide.closeWebDriver()- closes the whole browser
Now you don’t need to remember anything.
The old method
Selenide.close() is now deprecated. Going to delete it in Selenide 6.0.0
See issue 1016 and PR 1017.
- Wow! A new IDEA plugin for Selenide/Selenium: QA Lithium. Thanks to Yuriy Artamonov!
- Another framework on top of Selenide: Masquerade - CUBA Platform UI Testing Library
- Article about Selenide and Selenoid
- Another article about Selenide and Selenoid