Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is selenium 2.0?

1156


What’s selenese?

837


What are the programming languages supported by selenium webdiver?

982


What is selenium 3.0?

897


What is XPath? How does it work?

1119


What are different forms of selenium?

977


What are the different Exceptions in selenium?

951


Explain what are the junits annotation linked with selenium?

951


Explain me how to check a checkbox in selenium?

886


What is parameterization in testng? How to pass parameters using testng.xml?

892


What is the reason to use the selenium grid?

946


Tell us how you can use recovery scenario with selenium?

923


Explain the different kinds of frameworks in automation?

1036


How do you identify an object using selenium?

1000


What is the difference between poi and jxl jar?

956