Unable to see messages when using ITestListner of testNG


package List;
import org.openqa.selenium.By;

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.firefox.FirefoxDriver;

import org.testng.ITestContext;

import org.testng.ITestListener;

import org.testng.ITestResult;

import org.testng.annotations.Test;
public class DList implements ITestListener {
@Test

public void clear()

{

WebDriver driver=new FirefoxDriver();

driver.get("http://www.facebook.com");

driver.manage().window().maximize();

driver.findElement(By.id("email")).sendKeys("mukesh@facebook.com");

driver.findElement(By.id("wronglocator")).sendKeys("dont-tell");

driver.findElement(By.id("loginbutton")).click();
}
public void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {
}

public void onTestFailure(ITestResult arg0) {

System.out.println("test fail"+arg0.toString());
}
public void onTestSkipped(ITestResult arg0) {

System.out.println("test skipped"+arg0.toString());
}
public void onTestStart(ITestResult arg0) {

System.out.println("test started"+arg0.toString());
}
public void onTestSuccess(ITestResult arg0) {

System.out.println("test success"+arg0.toString());
}
public void onFinish(ITestContext arg0) {

System.out.println("test finished"+arg0.toString());
}
public void onStart(ITestContext arg0) {

System.out.println("initialized"+arg0.toString());
}

}

My Testng.xml file look like this………….

<?xml version=”1.0″ encoding=”UTF-8″?>
<!DOCTYPE suite SYSTEM “http://testng.org/testng-1.0.dtd”>
<suite name=”Test-listner” parallel=”none”>
<listners>
<listner class-name=”List.DList”>
</listner>
</listners>
<test name=”Batch-listner”>
<classes>
<class name=”List.DList”/>
</classes>
</test> <!– Test –>
</suite> <!– Suite –>

snpanigrahi9 Train Asked on December 22, 2014 in Selenium WebDriver.
Add Comment
0 Answer(s)

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.