セレンスクリプトを実行中にスクリーンショットをキャプチャしようとしています。しかし、以下のエラーを取得しています。誰でもこの問題を解決するために私を助けます。selenium webdriverでスクリーンショットが失敗しました
java.lang.ArrayIndexOutOfBoundsException:123 でorg.openqa.selenium.internal.Base64Encoder.mapCharToInt(Base64Encoder.java:89) org.openqa.selenium.internal.Base64Encoder.decode(Base64Encoderました。 Javaの:76) でorg.openqa.selenium.OutputType $ 2.convertFromBase64Png(OutputType.java:57) org.openqa.selenium.OutputType $ 2.convertFromBase64Png(OutputType.java:1) で org.openqaで.selenium.OutputType $ 3.convertFromBase64Png(OutputType.java:75) at org.openqa.selenium.Outputタイプ$ 3.convertFromBase64Png(OutputType.java:1) でorg.openqa.selenium.remote.RemoteWebDriver.getScreenshotAs(RemoteWebDriver.java:339)
は、コードの下に
File scrFile = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE);
nextVal = seq.incrementAndGet();
FileUtils.copyFile(scrFile, new File("./Screenshots/Sanity/" + nextVal + ".png"));
webdriver jarの正確なバージョンは何ですか? –
セレン-2.53.1.jar –
あなたのコードに何も問題はありません。おそらく、ドライバの実装が原因です。これが単なる実行時の問題ではない場合は、別のセレンのバージョンを試してください。 –