셀렌 스크립트를 실행하는 동안 스크린 샷을 캡처하려고합니다. 그러나 오류가 발생하고 있습니다. 누구든지이 문제를 해결할 수 있도록 도와줍니다.스크린 샷이 Selenium webdriver에서 실패했습니다.
java.lang.ArrayIndexOutOfBoundsException : org.openqa.selenium.internal.Base64Encoder.decode에서 org.openqa.selenium.internal.Base64Encoder.mapCharToInt (Base64Encoder.java:89) (Base64Encoder 123. 자바 : 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 org.openqa.selenium.remote.RemoteWebDriver.getScreenshotAs (RemoteWebDriver.java:339)
에서 유형 $ 3.convertFromBase64Png (OutputType.java:1는) , 코드 아래 사용하고
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 –
코드에 아무런 문제가 없습니다. 이는 드라이버 구현으로 인해 발생했을 수 있습니다. 이것이 일시적인 런타임 문제가 아니라면 다른 셀레늄 버전을 사용해보십시오. –