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 many exemptions do you know in selenium webdriver?

874


In which format does source view show the script in selenium ide?

859


How to configure selenium web driver in eclipse?

909


Is selenium capable of handling windows pop-ups?

903


In selenium what are breakpoints and startpoints?

936


When to use accessors in selenium?

1016


What is the automation test?

951


How does one capture a page title in selenium 2.0?

861


What do we mean selenium selenium 1 and 2?

861


How can you find if an element is displayed on the screen?

869


How to write selenium code for purchasing product from amazon

1521


How to download a file in selenium webdriver?

1009


What is the difference between driver.get() and driver.navigate.to()

911


What is the difference between find elements () and find element ()?

833


What is selenium webdriver or google webdriver or selenium 2.0?

801