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
What must one set within side in order to run a test from the beginning to a certain point within the test?
What are the verification points available in selenium?
Have you created any framework?
How is selenium different from qtp?
While injecting capabilities in webdriver to perform tests on a browser which is not supported by a webdriver what is the limitation that one can come across?
What is the main disadvantage of implicit wait?
How to deal with frame in webdriver?
Tell us how to perform right click using selenium webdriver?
What is selenium 1.0?
What type of tests have you automated?
Mention different exceptions you had in selenium web driver?
How to check which option in the dropdown is selected?
Write a code to wait for a particular element to be visible on a page. Write a code to wait for an alert to appear.
How to perform right click using webdriver?
What’s selenese?