"No one is harder on a talented person than the person themselves" - Linda Wilkinson ; "Trust your guts and don't follow the herd" ; "Validate direction not destination" ;

February 18, 2011

Test Automation Framework Using Selenium - Part III

[Next Post in Series]


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


After running TestNG test you would also see emailable-report.html. Please find snapshot



Improvements (Next Upcoming Posts)
  • Continous Integration Server
Pending Learning are below topics
  • Watir, Sahi
  • JavaScript, Python, Ruby
We have successfully covered basics of automation framework design, coding standards, data driven testing, reports and Logging as well. You can install Eclipse TestNG plug in from link

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!!

No comments: