Friday, 30 May 2014

Saturday, 24 May 2014

Data Driven Framework - Workbook.

Data Driven Framework for reading the test data from workbook (i.e. .xls (or) .xlsx files).
Below are the step for working with DDF - Workbook.

Prerequisite: 
1. Java 1.6
2. Eclipse IDE
3. Eclipse IDE configured with TestNG Plugin.

Download Apache POI, follow below process
1. Goto url: http://poi.apache.org/
2. Click on "download" link (i.e. http://poi.apache.org/download.html page opens)
3. Click on "poi-bin-<<version>>.zip" link
4. Select the mirror and download the "poi-<<version>>.zip"
5. Extract the downloaded "poi-<<version>>.zip" file, next step is to set the java build path.

Files required in java build path.
1. poi-<<version>>.jar
2. poi-ooxml-<<version>>.jar
3. poi-ooxml-schemas-<<version>>.jar

Open the "ooxml-lib" folder present in the extracted "poi-<<version>>.zip" file, set the below jar files in java build path.
4. dom4j-<<version>>.jar
5. xmlbeans-<<version>>.jar

Set the java build path for "AH-DDF-<<Version>>.jar" file, follow the below steps:
6. Download the  "AH-DDF-<<Version>>.zip" from repository.
7. Extract the "AH-DDF-<<Version>>.zip"
8. Extracted "AH-DDF-<<Version>>.zip" contains the "docs", "release notes", "AH-DDF-<<Version>>.jar" and "examples".
9. Set "AH-DDF-<<Version>>.jar" in the java build path.

Working with example program:
10. Copy the "examples" folder present in the extracted "AH-DDF-<<Version>>.zip" file into the "src" folder of Eclipse IDE project.
11. Update the .xls/.xlsx file path in "TestData.java" present at "\src\examples\test\excel\TestData.java"

Execution:
12. Execute the "TestData.java"
> Open the "TestData.java"
> Right click in the eclipse ide(i.e. in "TestData.java")
> Select the menu "Run As" --> "TestNG Test"
> "TestData.java" is executed by "TestNG API" with the help of "TestNG Plugin" configured in Eclipse IDE (Pre-requisite: TestNG Plugin is configured for Eclipse IDE).

13. Results (or) output is displayed in the Console.
> To see the console click on "Windows" menu --> "Show View" --> "Console"

DDF Workbook - Versions
Click on below links to access the pages.
DDF Workbook - Version 4.1
DDF Workbook - Version 3.0.4
DDF Workbook - Version 3.0.3
DDF Workbook - Version 3.0.2
DDF Workbook - Version 1.0

<< Previous

Data Driven Framework Overview


When working with automation frame work, the main issue is how to read the test data from the file.

Some times the automation utility method which is created in the automation frame works with limitations.

Common limitations in most of the Automation Frame Works:
1. Doesn't work if the column names are changed, since the header names are hard coded in the utility method.
Ex: test data header name "Desc" changed to "Details"

2. The utility method is designed for only specific kind of test data.
Ex: If test data is added with one more column, then the automation utility method need to be updated.

3. What if your "Manager" or "Team Lead" or "Client" is not interested in maintaining the test data in specific files(ex: spreadsheet), he suggests to maintain the test data in other file format(Ex: CSV format) and test cases already authored/developed are more. In this case team need to spend lot of time in tweaking the existing automation frame work.

4. If you are working with retrieving  the test data in the spread sheet(i.e. .xls/.xlsx files), since reading of test data is based on row number and column number, the automation utility method works for only specific data since retrieving of data is based on row & column number
Ex: if one more column is added in the spread sheet, the automation frame work you authored may not  work.

5. There are many more problems while reading the test data.

Don't worry we have the solution for all your problems. We have came up with new solution "Test Data Wrapper Utility"(i.e DDF) which will read the test data from different file types.

Stay tuned for more versions of DDF



Solution for reading the test data from different file types.

Table of Contents
Click the below links to access the pages.
1. Capturing the Test Data from Workbook (i.e. xlsx / xls file)
2. Capturing the Test Data from XML file.
3. Capturing the Test Data from CSV file.