STEP 7
Prerequisite : All the steps from STEP 1 to STEP 6 should survive followed properly equally described.
Till at ane time nosotros convey performed many unlike actions on selenium webdriver software automation testing framework creation - Starting from piece of work infinite creation to .xls files creation In STEP 1 to STEP 6. Now Its fourth dimension to Introduce but about
coding materials In our webdriver software automation testing data driven framework creation. As y'all know, We convey to read unlike types of .xls files(As described In STEP 6) In unlike ways In our software automation testing data driven framework. For reading information from .xls files in addition to writting results In .xls files, We are going to work apache POI API.Add "Read_XLS.java" File In "com.stta.utility" Package
To read information In specific format from .xls files in addition to write results In .xls files, I convey prepared Read_XLS.java shape file using Apache POI API. This file contains many unlike functions equally listed bellow which volition helps y'all to piece of work amongst .xls files.
Read_XLS.java Functions
- retrieveNoOfRows(String wsName) :- It volition provide No of Rows from worksheet of .xls file.
- retrieveNoOfCols(String wsName) :- It volition provide No of Columns from worksheet of .xls file.
- retrieveToRunFlag(String wsName, String colName, String rowName) :- You tin work this business office to read "SuiteToRun" flag from "SuitesList" canvas in addition to "CaseToRun" flag from "TestCasesList" sheet.
- public String[] retrieveToRunFlagTestData(String wsName, String colName) :- This business office volition tending y'all to read "DataToRun" flag from unlike examination cases information sheets.
- public Object[][] retrieveTestData(String wsName) :- This business office volition helps y'all to read Test Data from unlike examination cases information sheets.
- public boolean writeResult(String wsName, String colName, int rowNumber, String Result) :- This business office volition helps y'all to write Pass/Fail/Skip results In "TestCasesList" sheets and test cases information sheets.
- public boolean writeResult(String wsName, String colName, String rowName, String Result) :- This business office volition helps y'all to write execution status Skipped/Executed In "SuitesList" sheet.
You volition larn all inward a higher house listed features from Read_XLS.java file.
To add Read_XLS.java file In your webdriver software automation testing framework, Follow the bellow given steps.
- Download Read_XLS.java File
- Copy "Read_XLS.java" file from downloaded place in addition to glue It On "com.stta.utility" bundle of "WDDF" projection In Eclipse. It volition inquire for overwriting file - Click on "Yes" equally shown bellow. It volition add Read_XLS.java file In your framework's "com.stta.utility" package.
Now You tin opened upwards "Read_XLS.java" file In eclipse to persuasion all inward a higher house listed functions in addition to nosotros are gear upwards to work them In our framework.
Add "SuiteUtility.java" File In "com.stta.utility" Package
Function of "SuiteUtility.java" File
"SuiteUtility.java" file volition piece of work equally Intermediate file between "Read_XLS.java" file in addition to your test suite or examination cases files. It volition larn information reading or information writing requests from examination suite or or examination cases files in addition to post all those requests to "Read_XLS.java". And in addition to then "Read_XLS.java" volition perform required information reading or information writing activeness on targeted sheet.
To add SuiteUtility.java file In your framework, Follow the bellow given steps.
- Download SuiteUtility.java File.
- Copy "SuiteUtility.java" file from downloaded place in addition to glue It On "com.stta.utility" bundle of "WDDF" projection In Eclipse. It volition inquire for overwriting file - Click on "Yes" equally shown bellow. It volition add SuiteUtility.java file In your framework's "com.stta.utility" package.
Now our framework Is gear upwards to read information from unlike targeted .xls files in addition to write results In targeted .xls file.