How to capture screenshot in webdriver?



How to capture screenshot in webdriver?..

Answer / Zia Ur Rehman

To take a screenshot of the current page using Selenium, you can use the `TakesScreenshot` interface. Here's an example in Java: `File screenshot = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE);`

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Selenium Interview Questions

How you can use “submit” a form using selenium?

1 Answers  


What are the different exceptions you got when working with webdriver?

1 Answers  


If the test case frame contains several test cases, how can one execute just the selected one of those test cases?

1 Answers  


Explain dataproviders in testng using an example. Can I call a single data provider method for multiple functions and classes?

1 Answers  


When to use autoit?

1 Answers  


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

1 Answers  


Mention what are the types of listeners in testng?

1 Answers  


List the different types of drivers available in web drivers.

1 Answers  


How can you use the recovery scenario in selenium webdriver?

1 Answers  


Explain how to assert text of webpage using selenium 2.0?

1 Answers  


How can we create a data-driven framework using testng?

1 Answers  


Which browsers can selenium ide be run in?

1 Answers  


Categories