O'Reilly logo

Selenium Essentials by Prashanth Sams

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Properties file Data-Driven framework

The properties file is similar to the text file but with the .properties file extension. It is widely used in Java apps to store and configure parameters.

Data-Driven testing using the properties file as the data source is feasible on Selenium WebDriver to handle small data. Create a .properties file and store the keywords with a constant key (search). In Eclipse, open the project, right-click on the src folder and select New| Other... | General | File. Name the file with the.properties extension, for example, config.properties.

Let's see an example of how to read values from the properties file:

Properties file Data-Driven framework

Build a test class ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required