Wednesday, March 9, 2011

Data Driven Test Using Excel file


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

1. Create a Java Project

2. Create a JUnit Test case called "DataDrivenTestUsingXL"

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

4. Create a folder called "test-data"

5. Create a excel file called test-data.xls"

6. Under "Sheet1" add the test data as shown below
Figure: Test data in Excel file
7. Copy the following code into your junit test file and run
Figure: Data driven test using excel file



No comments:

Post a Comment