After the project is created, you need to setup the Selenium dependency, in order to use the library’s functionality. Make sure you always have the latest Selenium libraries available. The constant upgrade of the modern browsers might make some Selenium features unavailable or not working properly with older library versions.
To see what browser releases are scheduled in the future, you can check out these links:
The list of the latest browser binaries can be found here:
- For Chrome: http://chromedriver.storage.googleapis.com/index.html . In order to run Selenium tests on Chrome, you will need to download the latest binary version, and attach it to your project. You will need to copy this binary to your project, preferably into the following location: /src/test/resources/browserBinaries.
- For Firefox you will not need to download/add to your project any binaries, as Selenium will use the default location of the Firefox installation you have on your machine to run in the browser.
Testing with Selenium means interacting with a web page’s HTML code by means of a browser instance. The most common actions you can perform from Selenium are: clicking on a link, typing text into an input field, selecting items from a dropdown, selecting a radio button or ticking a checkbox. The Selenium elements holding the HTML bits that you will interact with are of type ‘webElement’. The webElements are declared either with XPATH or CSS selectors, as described in the next steps of this tutorial: https://imalittletester.com/2014/02/25/xpath-selectors/ and https://imalittletester.com/2014/02/25/css-selectors/ . Once a webElement declared, you can use the Selenium commands directly on it, to click, type or select values it contains, as described here: https://imalittletester.com/2014/02/25/creating-the-page-objects/.
But before that, a bit of introduction to HTML is neccessary: https://imalittletester.com/2014/02/25/html-and-selenium-an-introduction/.