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

How you build object repository in your project?

1049


What is difference between @factory and @dataprovider annotation?

1069


Why should Selenium be selected as a testing tool?

1068


How to configure selenium web driver in eclipse?

1027


How to type in a textbox using selenium?

1119


What is the difference between selenium ide, selenium rc, and webdriver?

1075


How many exceptions do you know in selenium webdriver?

1000


How does one store the current url using selenium 2.0?

1039


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?

948


Please explain what are the different types of locators in selenium?

968


What will be the different kinds of locators in selenium?

944


How to launch a browser using selenium webdriver?

1066


What difference do you make between soft vs. Hard to say in selenium?

1047


How to enter text in the HTML text box without invoking the SendKeys ()?

1072


Using selenium how can you handle network latency?

1120