Different Types of Reports used in Page Object Model (POM)
1.Basic reports provided by Selenium:
Under the cucumber options in your Test Runner file add the above file format under the plugin option. This will create a MyReports folder and under that folder it will generate the json, html, and junit reports . These are the basic reports provided by Selenium.
Once the project is created right click on the src\test\resources folder create
cucumber. properties file and add the below code.
cucumber. publish. enabled = true and save the file.
Once we execute the runner class of the respective project by default, we will get the cucumber report. In the console output we will get the URL to see the cucumber report. We should copy the URL and paste it in the address bar to view the report.
The URL is available only for 24hrs to view.
3.Generate Extent Spark, HTML and PDF Reports through adapter
Step 1 - In your pom.xml file add the following dependencies.
After adding the dependencies, you have to do certain configurations. Right click on the src/test/resources and create two new files extent. properties and extent-config.xml files.
Step 2 - Once the two files are created add the following code to the extent. properties file and save it.
Under the extent-config.xml file add the below code and save it
Step 3 - Add the below adapter to your Test Runner file.
Once all the three steps are done, when you run the TestRunner file Extent reports are generated under the test output folder
4. Allure Reports
Add the Maven dependencies TestNG, Selenium java, WebDriver Manager and Allure-TestNG
Download the Allure binaries from below link
Download the appropriate file base on your OS
Unzip the file and set the path in the environment variables
In command prompt go to your project folder where your allure results folder exists and run the allure serve command as shown in the below screenshot
Allure Reports will be generated.
Thanks for Reading, HAPPY LEARNING!!!