Prerequisite : All required class files should be created as described In STEP 5.
After creating all required classes under different packages, Now It Is time to create required .xls files. Please note here that this framework will not support .xlsx files but It will support only .xls files so please create only .xls files as described bellow. In our selenium WebDriver software testing Framework, We willProgrammatically read the different .xls files to retrieve Suites Name, SuiteToRun flags, Test cases names, CaseToRun flags, Test data for different test cases and many more things and then feed all these data to our test suites and test cases. Also we will write the results or execution status In .xls files at the end of test cases. Anyways, Don't consider all these things at this stage because we will learn all these things step by step In my upcoming posts. Right now your task Is to add bellow given three .xls files under com.stta.ExcelFiles package.
Click on bellow given links one by one to download .xls files and then add them In com.stta.ExcelFiles ("E:\backup\Training\WDDF\src\com\stta\ExcelFiles") package Folder.
Now "com.stta.ExcelFiles" package will looks like bellow.
Note : Don't change any thing In any .xls files.
"TestSuiteList.xls" File Explaination
Now open "TestSuiteList.xls" file. If you look In file, 1st sheet's name Is "SuitesList". Inside "SuitesList" sheet, There are total three columns as bellow.
- SuiteName : It will be used for listing all available test suites. Initially we are using only two test suites In our software testing data driven framework creation so listed only two test suites(SuiteOne and SuiteTwo). Later on you can add more test suites In this list.
- SuiteToRun : This column will be used to decide that specific test suite should be executed or not. If set "Y" In this column then that specific test suite will be executed. If set "N" In this column describes that specific suite will not execute or you can say you wants to skip execution of that specific test suite.
- Skipped/Executed : This column will be used to write specific test suite was executed or not. Right now It Is blank but It will be set to "Skipped" or "Executed" during test suite execution.
"SuiteOne.xls" and "SuiteTwo.xls" Files Explaination
If you will open any of the file from "SuiteOne.xls" and "SuiteTwo.xls", 1st sheet name will be "TestCasesList". This sheet has total three columns as bellow.
- TestCaseName : Test cases of that specific suite will be listed In this column.
- CaseToRun : You can set test case execution mode In this column.
- Pass/Fail/Skip : Test case "Pass" or "Fail" or "Skip" status will be reported automatically In this column at the end of each test case execution.
There are more two sheets Inside "SuiteOne.xls" and "SuiteTwo.xls" files. Both those sheets will be used to store test data for specific test case of software application. Example : In "SuiteOne.xls" file, "SuiteOneCaseOne" sheet will be used to store data of test case class "SuiteOneCaseOne.java". Same way "SuiteOneCaseTwo" sheet will be used to store data of test case class "SuiteOneCaseTwo.java". Same thing apply for "SuiteTwo.xls" file.
Please Remember always :- Test class name of your eclipse project(Example : SuiteOneCaseOne.java), TestCaseName In "TestCasesList" sheet(SuiteOneCaseOne) and Test Data Sheet name (SuiteOneCaseOne) must be always same as shown In bellow given Image. So when ever you create new test case under any test suite In this framework, Keep this thing In your mind.
Test Data Sheets Explanation
If you will open any data sheet(Example : SuiteOneCaseOne) from "SuiteOne.xls" and "SuiteTwo.xls" files, you will see bellow given columns In each sheet.
- Data 1 Column, Data 2 Column, Data 3 Column : All these three columns will be used to store test data for that specific test case for software web application. You can Increase or decrease these column's name as per your test case data requirement.
- Expected Result Column : You can store expected result data In this column to compare with actual result.
- DataToRun : This column will be used to decide that specific data line should be executed or not. If set "N" then that specific data set line will be not executed. If set "Y" then that specific data set line will be executed.
- Pass/Fail/Skip : Result will be reported automatically In this column As per expected and actual result matching criteria. Result can be "Pass" or "Fail" or "Skip".
This way, You need to add above given .xls files with specified format for your data driven framework of software web application. Initially we will add only two test suites each having two test cases. Each test case have two data sets.