Skip to content
startingwithseleniumwebdriver edited this page Oct 10, 2016 · 3 revisions

RealTimeReport is created to get the TestNG test result status at runtime of the test. Advantage of this report is that - user don't need to change their existing code base to generate this report, only need to add a listener tag to generate this realtime report.


Implementation:

Let's take an example - normal testng.xml file looks like

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Suite">
<test name="Test">
	<classes>
		<class name="report.test.google.VerifyGoogleHome" />
	</classes>
</test> <!-- Test -->
</suite> <!-- Suite --> 

The above normal testng.xml will generate report at the end of the test. But if user have wish to generate report during test (at runtime) then simply add the "RealTimeTestResultListener" listener tag in testng.xml file as shown below:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Suite">
<listeners>
	<listener class-name="report.realtime.listener.RealTimeTestResultListener" />
</listeners>
<test name="Test">
	<classes>
		<class name="report.test.google.VerifyGoogleHome" />
	</classes>
</test> <!-- Test -->
</suite> <!-- Suite -->  

Under the root of project directory, a RealtimeReport directory will be created automatically just after the suite starts execution. (NOTE: please refresh the project at your IDM to view the new directory)

reportfolder

Under the RealTimeReport directory user will get index.html file and it will looks as

index

To get the details of each of the suite result user need to click on the particular Suite link. The redirected page looks like below

suiteresult

Clone this wiki locally