1

Not able to capture screen shots for electron application using java .

Here is my code for webdriver setup.

ChromeOptions chromeOptions = new ChromeOptions();
    chromeOptions.setBinary("/Applications/betlite.app/Contents/MacOS/appname");
        DesiredCapabilities capabilities = new DesiredCapabilities();
        capabilities.setCapability(ChromeOptions.CAPABILITY, chromeOptions);
        driver = new ChromeDriver(capabilities);

Using following method to capture screen , it do work for traditional ChromeDriver .

public static void captureScreenMethod() throws IOException, InterruptedException
    {
        File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
          Thread.sleep(4000);
        FileUtils.copyFile(scrFile, new File("path_of_file/screenshot.png"));
    }

I am getting following error -

org.openqa.selenium.WebDriverException: unknown error: cannot get automation extension from unknown error: page could not be found: chrome-extension://aapnijgdinlhnhlmodcfapnahmbfebeb/_generated_background_page.html

I am using MAC OS

Thanks

cod
  • 151
  • 4
  • 13

0 Answers0