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
6. Now, double click on "testdata.properties" file and enter the following data - Filter_Task=page design,page updates
7. Now copy the below code from the following figure and run your JUnit test case
Reference: http://kirankanumuri.blogspot.com/2010/10/how-to-do-data-driven-testing.html
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 |
Figure: Test data in properties file |
Figure: Data Driven Test Using Properties File |
No comments:
Post a Comment