seleniumonlinetutor

Selenium Interview : How will you capture screenshot in Selenium webDriver?

How will you take screenshot in Selenium webDriver? Answer: The screenshot can be taken by using getScreenshotAs() method. The sample code is as follows: public class myTestSuite { @Test public void testcase1() { // Open Firefox WebDriver driver=new FirefoxDriver(); // Maximize the window driver.manage().window().maximize(); // Open the url driver.get(“http://www.google.com”); // Take screenshot and store as […]

Read More »