In continuation with previous posts we are now going to look at logging. Please refer to TestNG earlier posts for examples. I attribute my learning on logging to post. Thanks to Bindu Laxminarayan.
Added two files SuiteReporter.java and TestReporter.java. You can copy/paste the contents of file from the blog post. You can right click on TestRun.java and select option Convert to TestNG as per below snapshot
We need to edit the xml file as provided below testng.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Suite" parallel="none">
<listeners>
<listener class-name="SuiteReporter" />
<listener class-name="TestReporter" />
</listeners>
<test name="Test" preserve-order="false">
<classes>
<class name="TestRun"/>
</classes>
</test>
</suite>
You can run TestRun.java as TestNG test. In the console window you will see below entries logged
Improvements (Next Upcoming Posts)
- Continous Integration Server
- Watir, Sahi
- JavaScript, Python, Ruby
More Reads -
Better reporting with ReportNG
Using Firebug for Load Testing
TestNG XML Driven Parameters
Using Firebug in IE
How to setup a Test Automation Infrastructure using Selenium, JUnit, Hudson & ANT
Happy Reading!!