Issue: Runtime error occurs when taking a screenshot | Selenium Forum
M
Mukesh Raja Posted on 25/01/2021
 
When taking a screenshot using the below code
 
WebDriver augmentedDriver = new Augmenter().augment(driver);
// lastScreenshotFile = ((TakesScreenshot) augmentedDriver).getScreenshotAs(OutputType.FILE);
the following error occurs
 
java.lang.RuntimeException: Unexpected result for screenshot command: com.google.common.collect.Maps$TransformedEntriesMap instance
at org.openqa.selenium.remote.RemoteWebDriver.getScreenshotAs(RemoteWebDriver.java:352)
 
chrome Driver:ChromeDriver 87.0.4280.88 
windows 10, 64-bit OS

selenium: selenium-server-4.0.0-alpha-7.jar


A
Ashish Replied on 28/01/2021

Please use selenium alpha 6 jar


M
Mukesh Raja Replied on 29/01/2021

Thank you Ashish, alpha 6 works for with Chrome
However when IE is used with IEDriverServer.exe of 3341 KB, the IE browser opens and immediately throws the error below. can you please suggest what i missed ?

system: Windows 10
IE version: 11

Driver info: driver.version: unknown
at org.openqa.selenium.grid.distributor.local.LocalDistributor.lambda$newSession$4(LocalDistributor.java:167)
at java.base/java.util.Optional.orElseThrow(Optional.java:408)
at org.openqa.selenium.grid.distributor.local.LocalDistributor.newSession(LocalDistributor.java:161)
at org.openqa.selenium.grid.distributor.Distributor.lambda$new$0(Distributor.java:88)
at org.openqa.selenium.remote.http.Route$TemplatizedRoute.handle(Route.java:183)
at org.openqa.selenium.remote.http.Route.execute(Route.java:67)
at org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:327)
at org.openqa.selenium.remote.http.Route.execute(Route.java:67)
at org.openqa.selenium.grid.distributor.Distributor.execute(Distributor.java:123)
at org.openqa.selenium.remote.tracing.SpanWrappedHttpHandler.execute(SpanWrappedHttpHandler.java:75)
at org.openqa.selenium.remote.http.Filter$1.execute(Filter.java:64)
at org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:327)
at org.openqa.selenium.remote.http.Route.execute(Route.java:67)
at org.openqa.selenium.grid.router.Router.execute(Router.java:67)
at org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:327)
at org.openqa.selenium.remote.http.Route.execute(Route.java:67)
at org.openqa.selenium.grid.server.AddWebDriverSpecHeaders.lambda$apply$0(AddWebDriverSpecHeaders.java:30)
at org.openqa.selenium.grid.server.WrapExceptions.lambda$apply$0(WrapExceptions.java:36)
at org.openqa.selenium.remote.http.Filter$1.execute(Filter.java:64)
at org.openqa.selenium.netty.server.SeleniumHandler.lambda$channelRead0$0(SeleniumHandler.java:46)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.openqa.selenium.remote.W3CHandshakeResponse.lambda$errorHandler$0(W3CHandshakeResponse.java:62)
at org.openqa.selenium.remote.HandshakeResponse.lambda$getResponseFunction$0(HandshakeResponse.java:30)
at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$0(ProtocolHandshake.java:126)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.Spliterators$ArraySpliterator.tryAdvance(Spliterators.java:958)
at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126)
at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:499)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:486)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
at java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:152)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:464)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:128)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:74)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:136)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:213)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:131)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:144)
at gov.idaho.dhw.supportlibrary.supportlibraries.WebDriverFactory.getDriver(WebDriverFactory.java:370)
at gov.idaho.dhw.supportlibrary.supportlibraries.WebDriverFactory.getDriver(WebDriverFactory.java:204)
at gov.idaho.dhw.supportlibrary.supportlibraries.DriverScript.initializeWebDriver(DriverScript.java:200)
at gov.idaho.dhw.supportlibrary.supportlibraries.DriverScript.driveTestExecution(DriverScript.java:101)
at gov.idaho.dhw.supportlibrary.runner.ParallelRunner.invokeTestScript(ParallelRunner.java:54)
at gov.idaho.dhw.supportlibrary.runner.ParallelRunner.run(ParallelRunner.java:28)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)


A
Ashish Replied on 30/01/2021

You need to have  a lot of config settings with IE

Have you lloked at the video describing those?


Related Posts