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 many exemptions do you know in selenium webdriver?
In which format does source view show the script in selenium ide?
How to configure selenium web driver in eclipse?
Is selenium capable of handling windows pop-ups?
In selenium what are breakpoints and startpoints?
When to use accessors in selenium?
What is the automation test?
How does one capture a page title in selenium 2.0?
What do we mean selenium selenium 1 and 2?
How can you find if an element is displayed on the screen?
How to write selenium code for purchasing product from amazon
How to download a file in selenium webdriver?
What is the difference between driver.get() and driver.navigate.to()
What is the difference between find elements () and find element ()?
What is selenium webdriver or google webdriver or selenium 2.0?