0

I am getting a class not found error in Selenium while writing test case for Capture the Screenshot. Please give the suggestions for resolving my error.

package org.openqa.selenium.chrome;
import java.io.File;
import java.io.IOException;

import org.apache.commons.io.FileUtils;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.TakesScreenshot;
import org.openqa.selenium.WebDriver;

public class Miscellaneous {

    public static void main(String[] args) throws IOException {
        // TODO Auto-generated method stub
        WebDriver driver = new ChromeDriver();
        driver.manage().window().maximize();
        driver.get("https://apple.com");
        //driver.manage().deleteAllCookies();
        //File img = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
        //FileUtils.copyFile(img, new File("C://Users//yaswa//TestingPractice.png"));
        TakesScreenshot ss = (TakesScreenshot)driver;
        File src = ss.getScreenshotAs(OutputType.FILE);
        File trg = new File("C://Users//yaswa//Practice.png");
        FileUtils.copyFile(src, trg);
        
    
    }

}
Federico klez Culloca
  • 26,308
  • 17
  • 56
  • 95
Yaswanth
  • 1
  • 1
  • Hello and welcome. For your future questions please post code (in the form of a [example]) and error messages as text in the question, not as screenshots. – Federico klez Culloca Jan 02 '23 at 08:39

0 Answers0