Keyword-driven testing is a type of functional automation testing framework which is also known as table-driven testing or action word based testing.
In Keyword-driven testing, we use a table format, usually a spreadsheet, to define keywords or action words for each function that we would like to execute.
For Demo purpose all the test cases are created for JPetStore Demo site.
Components of a Keyword Driven Framework
- Excel Sheet : It is used to store the data for test cases such as keywords, data values etc.
- Object Repository : This stores the locator values for web elements.
- Action Library: It is used to create functions that perform actions specified by keywords.
- Test Executor: This is the driver engine that interacts with action classes and excel file to execute the test case.
###Some of the key features of this framework:
- It generates Extent report with all the step details.
- It support parallel execution of test cases.
- It generates test execution log file.
- Test execution can be triggered form command line.
- Easy integration to CI/CD pipeline.
- Framework uses Page Object Design Pattern, hence there is clean separation between test code and page specific code such as locators and layout.
- Test cases to executed can be decided by passing Yes/No value in excel file.
- Java should be installed and configured.
- Maven should be installed and configured.
- Download the files from Git repository either as zip file OR using Git.
-
Navigate to src/test/resources/data/TestDataSheet.xlsx and update the excel sheet with test cases to execute with Yes/No value.
-
Open the command prompt and navigate to the folder in which pom.xml file is present.
-
Run the below Maven command.
mvn clean verify
Once the execution completes Extent Report will be generated in below folder structure.
Extent Report--> /target/html-report/index.html