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

2 comments: