ANT and other file's configuration to generate XSLT Reports for selenium webdriver software automation test Is already done In previous STEP 19. So now configuration part Is over to generate XSLT reports. In this step, We will learn how to generate XSLT reports for selenium software test data driven framework.
Prerequisite : All previous 19 steps of selenium webdriver software testing data driven framework should be Implemented. You will find the links for all the previous steps on THIS PAGE.
Run Test Suites To Generate TestNG Report
Before generating XSLT reports, You need to run your test suites from "testng.xml" file because XSLT reports are generated using "testng-results.xml" file and this file will be generated when your run your test from testng.xml file.
Please keep this thing In your mind -> If you are changing something In your software automation test cases or project configuration after running your test cases and then you are going to generate XSLT reports then you can get wrong result or error during XSLT reports generation. So always generate XSLT reports just next to your test suites execution completion.
Run your test suites from testng.xml file. Your testng result report will look like bellow when you will open index.html file from test-output folder.
Note : Now you can execute your test suites from command prompt too using ant run command. See bellow given steps.
Generate XSLT Reports
Once your test execution get completed and testng results generated, We can go to generate XSLT report. You need to follow bellow given steps to generate XSLT report.
- Open command prompt.
- Set Project Path : Go to your "WDDF" project directory In command prompt where your "build.xml" file Is stored as shown In bellow Image. Command = cd E:\backup\Training\WDDF
- Verify build.xml Is Accessible : Type command = ant In command prompt and press enter to check that we are at correct place to generate XSLT reports or not. It should give message "BUILD SUCCESSFUL" as shown In bellow given Image.
- Remove Previous Build Folder If Any : Type Command = ant clear In command prompt and press enter. It should give message "BUILD SUCCESSFUL" as shown In bellow given Image.
- Verify Build Folder Is Generated : Now Refresh your "WDDF" project In eclipse. ant compile command will created new folder with name = build under your project as shown In bellow given Image.
- Execute Test Suites : Type Command = ant run In command prompt and press enter. It will execute your all software automation test suites which are included In testng.xml file.
So now you can execute your software test suites from command prompt Instead of testng.xml file.
- Generate XSLT Reports : Type Command = ant reports In command prompt and press enter. It should give message "BUILD SUCCESSFUL" as shown In bellow given Images.
- Open XSLT Report : Once more refresh your "WDDF" project In eclipse. ant reports command will create new folder with name = XSLT_Reports under your project as shown In bellow given Image.
- You will find index.html file In XSLT_Reports folder. That Is XSLT Report of your webdriver test. Open that file In any web browser. It will look like bellow.
You can click on test case name In left side column(TestNG Results column) to view test case result In detail. If you look at above report, It Is Interactive and easy to understand that how many test cases are Pass, Fail and Skip for specific test case.
So we achieved our target of generating XSLT reports for our selenium webdriver software test data driven framework.