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
Explain Cucumeber Framework?
What is the difference b/w close () and quit ()?
What is the syntax of finding elements by id using css selector?
How to handle keyboard and mouse actions using selenium?
How do you upload a file?
What is datadriven framework and keyword driven?
What is selenium 2.0?
How you can find broken images in a page using selenium web driver?
What is selenium? What are the different selenium components?
Which are the operating systems supported by selenium?
What is the difference between MaxSessions vs. Selenium grid MaxInstances properties?
How many types of locators are there in selenium?
How to handle dropdowns in selenium?
What are the locators available in selenium?
What are the advantages of automation framework?