Wednesday, March 9, 2011

Data Driven Test Using Properties file

Following steps will guide you how to do data driven tests by using .properties file.

1. Create a Java Project

2. Create a JUnit Test case

3. Add junit and selenium-server jar files to build path

4. Now right click on the source folder and select New ->File

5. Enter File name as "testdata.properties" and "Finish" button
Figure: Creating properties file
6. Now, double click on "testdata.properties" file and enter the following data - Filter_Task=page design,page updates
Figure: Test data in properties file
7. Now copy the below code from the following figure and run your JUnit test case
Figure: Data Driven Test Using Properties File
Reference: http://kirankanumuri.blogspot.com/2010/10/how-to-do-data-driven-testing.html

No comments:

Post a Comment