In this video will see how to take/capture screenshot for any web page for selenium webdriver.
I hope you like this video. For any questions, suggestions or appreciation please contact us at: https://programmerworld.co/contact/ or email at: programmerworld1990@gmail.com
Details:
public static void main(String[] args) throws AWTException {
// TODO Auto-generated method stub
System.setProperty("webdriver.chrome.driver", "Path of chromedriver exe\\chromedriver.exe");
ChromeOptions op = new ChromeOptions();
op.setBinary("Path of chromexe\\chrome.exe");
op.addArguments("--remote-allow-origins=*");
WebDriver driver = new ChromeDriver(op);
driver.get("https://programmerworld.co/");
File f = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
Files.copy(f, new File("Path of Directory where you want to save the screenshot\\Name of the Screenshot.jpg"));
}
Excerpt:
In this video, you will learn how to capture a screenshot of any web page using Selenium WebDriver. The code snippet provided demonstrates the process using Java, including setting up the Chrome driver, navigating to the web page, and capturing the screenshot. The excerpt includes a link to the video tutorial and an image related to the topic. For further inquiries or feedback, the contact information for the programmerworld.co website is also provided.