How to capture the screenshot of failed testcase only among a set of testcases?
Answer Posted / suresh vemula
First we have to create a method of screen shot using java.
After that we have annotation in testng to identify the failure test case or methods using "iTestResult"
This iTestResult using only where annotation in aftermethod
@Aftermethod
Public void test(iTestResult.FAILURE==result.getStatus()){
Utility.screenshot(driver,result.getname());
}
Here utility.screenshot is java class to created for screenshot
Here getName() returns the failure test case name
Then you have to identify the failure test easily
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
How you build object repository in your project?
What is difference between @factory and @dataprovider annotation?
Why should Selenium be selected as a testing tool?
How to configure selenium web driver in eclipse?
How to type in a textbox using selenium?
What is the difference between selenium ide, selenium rc, and webdriver?
How many exceptions do you know in selenium webdriver?
How does one store the current url using selenium 2.0?
How would one access the value of a side variable named name from within a javascript snippet used as the argument to a selenese command?
Please explain what are the different types of locators in selenium?
What will be the different kinds of locators in selenium?
How to launch a browser using selenium webdriver?
What difference do you make between soft vs. Hard to say in selenium?
How to enter text in the HTML text box without invoking the SendKeys ()?
Using selenium how can you handle network latency?