Saturday, October 7, 2017

RealTime Report On Selenium WebDriver + TestNG

This is becoming an emerging need to have a compact and catchy Test Report after execution of the Tests. But what about if you will have the same compactness of the report at the Test Run Time?

Yes you can, if we expect to get a report in the middle of the execution you can implement this RealTimeReport to your project.


All the expectations below can be achieved through this:

  1. Get test report at Run Time - don't need to wait till end of the test execution.
  2. Only adding our pre-defined listener in user's testng.xml file can generate this report. So, NO need to change code. As an added benefit - you can implement this report in your existing project without making any change in your code.


It is very easy to use we need to follow the below steps :

Step 1:

We need to copy the below mentioned 5 packages under the src folder.


Step 2:

Copy the below folder and keep this folder under the root of the project.


Step 3:

Now add following to your testng.xml file
<listeners>
    <listener class-name="report.realtime.listener.RealTimeTestResultListener" />
</listeners>

Step 4:
 Now execute test using testng.xml file.

Step 5:

 After starts the execution RealtimeReport directory will be created under the root of the project and generate the beautiful report along with the execution status.