Changes in Selenide 2.12

Changes in Selenide 2.12

File upload, select support, webdriver logs

Hello QA geeks!

Great news: we have released Selenide 2.12. Let’s see what’s coming with it.

Added function $.uploadFile(File)

The function allows you to upload a file.

   File cv = new File("src/test/resources/cv.pdf");

Selenide already had a similar function $.uploadFromClasspath(String fileName). It searched the file for uploading in classpath. We believe that holding test file together with test sources is a good practice (meaning that test files get to classpath during project compilation).

But we realized that sometimes it’s convenient to upload some file from another place.

Fixed function $.uploadFromClasspath

It appeared that webdriver fails when trying to upload a file like c:/src/test/java/../resources/cv.pdf. We improved function $.uploadFromClasspath, so that it removes extra “..” parts from file name.


Function $.val(“john”) also works for selects

Function $.val has got a little bit smarter. It called on SELECT field, it chooses the right OPTION with corresponding value. This is one more step towards the idea that developer doesn’t need to think about implementation details and can concentrate on business logic. You just write $("#sex").val("female") and don’t think either it’s INPUT or SELECT - Selenide detects it automatically and performs required action.

Technically, $("select").val("yes") - is a synonym for $("select").selectOptionByValue("yes").

Added function getWebDriverLogs().

The function reads webdriver logs. Technically it’s synonym for webdriver.manager().logs(). In theory, these logs can contain very useful information about browser errors, javascript errors, performance problems etc. In practice, webdriver logs are not well supported by all webdrivers. We do not understand how to use them efficiently. Please share with us if you have any experience with webdriver logs!

Upgraded to Selenium 2.42.2 and HtmlUnit 2.15

We haven’t experienced any problems with the new Selenium.

Thanks again to Selenium authors for the great product!

And what’s new with you?