org.openqa.selenium.WebDriverException for appium on selenium4 for getScreenshotAs method

332 Views Asked by At

I am trying to take screenshot using the getScreenshotAs method using selenium 4 remotely on saucelabs(appium). It is working absolutely fine locally whereas running remotely, I am getting the following error:

Error org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Could not proxy. Proxy error: Could not proxy command to remote server. Original error: 404 - "unknown command: session/f1ac120701306ea3a254297a9bb8516a/screenshot/0.07080016425056002-1"

Code

void captureScreenShotOf(WebElement el, WebDriver driver) {
    File newImg = el.getScreenshotAs(OutputType.FILE);
    try {
        FileUtils.copyFile(newImg, new File("./screenshot/expected.jpg"));
    } catch (Exception e) {
        e.printStackTrace();
    }
}

Error Image ErrorImage

0

There are 0 best solutions below