Script time out error when using element attribute in Chrome

Script time out error when using element attribute in Chrome

Error executing WebElementAction
  com.workfusion.studio.rpa.recorder.playback.PlaybackException: Error executing TemplateAction[templateName=WebElementAction.ftl,id=20,name=Optional[WebElementAction],parent=6,nextSibling=21,arguments=ActionArguments[varName=[lst_temp],elementAttribute=[alt],exactMatch=[true],xsi:type=[recorder:WebElementAction, recorder:WebElementAction],pollingInterval=[300],active=[true],searchInFrames=[false],delay=[3],useElementAttribute=[true],timeoutMs=[10000],webElementLocatorType=[XPATH],comment=[Capture supported devices],webElementLocator=[//*[contains(@class, 'supported-devices__grid')]/li//img[1]],awaitTimeout=[5000]]]
      at com.workfusion.studio.rpa.recorder.playback.flow.StandardControlFlow.execute(StandardControlFlow.java:54)
      at com.workfusion.studio.rpa.recorder.playback.action.template.TemplateAction.execute(TemplateAction.java:28)
      at com.workfusion.studio.rpa.recorder.playback.action.template.TemplateAction.execute(TemplateAction.java:15)
      at com.workfusion.studio.rpa.recorder.playback.player.ActionPlayer.next(ActionPlayer.java:81)
      at com.workfusion.studio.rpa.recorder.player.PlaybackLogic.playNextAction(PlaybackLogic.java:154)
      at com.workfusion.studio.rpa.recorder.player.PlaybackLogic.run(PlaybackLogic.java:112)
      at java.lang.Thread.run(Thread.java:745)
  Caused by: org.openqa.selenium.ScriptTimeoutException: script timeout
  (Session info: chrome=77.0.3865.120)
Build info: version: '9.3.0.5', revision: '63553f3f1c', time: '2019-03-15T13:41:27.26Z'
System info: host: 'GERI850', ip: '192.168.15.214', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_121'
Driver info: org.openqa.selenium.remote.RemoteWebDriver
Capabilities [{networkConnectionEnabled=false, chrome={chromedriverVersion=77.0.3865.40 (f484704e052e0b556f8030b65b953dce96503217-refs/branch-heads/3865@{#442}), userDataDir=C:\Users\GSTOYA~1\AppData\Local\Temp\scoped_dir14092_377116150}, timeouts={implicit=0, pageLoad=300000, script=30000}, pageLoadStrategy=normal, unhandledPromptBehavior=dismiss and notify, strictFileInteractability=false, platform=XP, proxy=Proxy(), goog:chromeOptions={debuggerAddress=localhost:54665}, acceptInsecureCerts=false, browserVersion=77.0.3865.120, browserName=chrome, javascriptEnabled=true, platformName=XP, setWindowRect=true}]
Session ID: c833a99ce5c24385ad4a56cf4c0d622a
Command duration or timeout: 0 milliseconds
      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.ErrorHandler.createThrowable(ErrorHandler.java:216)
      at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:168)
      at org.openqa.selenium.remote.http.JsonHttpResponseCodec.reconstructValue(JsonHttpResponseCodec.java:41)
      at org.openqa.selenium.remote.http.AbstractHttpResponseCodec.decode(AbstractHttpResponseCodec.java:82)
      at org.openqa.selenium.remote.http.AbstractHttpResponseCodec.decode(AbstractHttpResponseCodec.java:45)
      at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:164)
      at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:741)
      at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:289)
      at org.openqa.selenium.remote.RemoteWebElement.getAttribute(RemoteWebElement.java:136)
      at com.workfusion.rpa.helpers.UiElement.getAttribute(UiElement.java:1239)
      at org.openqa.selenium.WebElement$getAttribute$0.call(Unknown Source)
      at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:128)
      at Script19$_run_closure1.doCall(Script19.groovy:11)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:104)
      at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:326)
      at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:264)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1041)
      at groovy.lang.Closure.call(Closure.java:421)
      at org.codehaus.groovy.runtime.ConvertedClosure.invokeCustom(ConvertedClosure.java:54)
      at org.codehaus.groovy.runtime.ConversionHandler.invoke(ConversionHandler.java:124)
      at com.sun.proxy.$Proxy40.apply(Unknown Source)
      at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
      at java.util.ArrayList$Itr.forEachRemaining(ArrayList.java:891)
      at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
      at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
      at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
      at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
      at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
      at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
      at java_util_stream_Stream$collect.call(Unknown Source)
      at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:128)
      at Script19.run(Script19.groovy:11)
      at com.workfusion.studio.rpa.recorder.playback.shell.GroovyShellWrapper.executeScript(GroovyShellWrapper.java:48)
      at com.workfusion.studio.rpa.recorder.playback.player.PlaybackContext.executeScript(PlaybackContext.java:108)
      at com.workfusion.studio.rpa.recorder.playback.action.template.TemplateAction.executeBehavior(TemplateAction.java:33)
      at com.workfusion.studio.rpa.recorder.playback.flow.StandardControlFlow.execute(StandardControlFlow.java:46)
      at com.workfusion.studio.rpa.recorder.playback.action.template.TemplateAction.execute(TemplateAction.java:28)
      at com.workfusion.studio.rpa.recorder.playback.action.template.TemplateAction.execute(TemplateAction.java:15)
      at com.workfusion.studio.rpa.recorder.playback.player.ActionPlayer.next(ActionPlayer.java:81)
      at com.workfusion.studio.rpa.recorder.player.PlaybackLogic.playNextAction(PlaybackLogic.java:154)
      at com.workfusion.studio.rpa.recorder.player.PlaybackLogic.run(PlaybackLogic.java:112)
      at java.lang.Thread.run(Thread.java:745)
  Caused by: org.openqa.selenium.ScriptTimeoutException: script timeout
  (Session info: chrome=77.0.3865.120)
Build info: version: '9.3.0.5', revision: '63553f3f1c', time: '2019-03-15T13:41:27.26Z'
System info: host: 'GERI850', ip: '192.168.15.214', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_121'
Driver info: org.openqa.selenium.remote.RemoteWebDriver
Capabilities [{networkConnectionEnabled=false, chrome={chromedriverVersion=77.0.3865.40 (f484704e052e0b556f8030b65b953dce96503217-refs/branch-heads/3865@{#442}), userDataDir=C:\Users\GSTOYA~1\AppData\Local\Temp\scoped_dir14092_377116150}, timeouts={implicit=0, pageLoad=300000, script=30000}, pageLoadStrategy=normal, unhandledPromptBehavior=dismiss and notify, strictFileInteractability=false, platform=XP, proxy=Proxy(), goog:chromeOptions={debuggerAddress=localhost:54665}, acceptInsecureCerts=false, browserVersion=77.0.3865.120, browserName=chrome, javascriptEnabled=true, platformName=XP, setWindowRect=true}]
Session ID: c833a99ce5c24385ad4a56cf4c0d622a
Build info: version: '9.3.0.5', revision: '63553f3f1c', time: '2019-03-15T13:41:27.26Z'
System info: host: 'GERI850', ip: '192.168.15.214', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_121'
Driver info: driver.version: RemoteWebDriver
      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.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:186)
      at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:121)
      at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:50)
      at org.openqa.selenium.remote.server.ActiveSessionCommandExecutor.execute(ActiveSessionCommandExecutor.java:43)
      at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:741)
      at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:289)
      at org.openqa.selenium.remote.RemoteWebElement.getAttribute(RemoteWebElement.java:136)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at org.openqa.selenium.remote.server.KnownElements$1.invoke(KnownElements.java:64)
      at com.sun.proxy.$Proxy17.getAttribute(Unknown Source)
      at org.openqa.selenium.remote.server.handler.GetElementAttribute.call(GetElementAttribute.java:36)
      at org.openqa.selenium.remote.server.handler.GetElementAttribute.call(GetElementAttribute.java:22)
      at org.openqa.selenium.remote.server.handler.WebDriverHandler.handle(WebDriverHandler.java:41)
      at org.openqa.selenium.remote.server.rest.ResultConfig.handle(ResultConfig.java:134)
      at org.openqa.selenium.remote.server.JsonHttpCommandHandler.handleRequest(JsonHttpCommandHandler.java:206)
      at org.openqa.selenium.remote.server.InMemorySession.execute(InMemorySession.java:98)
      at org.openqa.selenium.remote.server.WebDriverServlet.lambda$handle$0(WebDriverServlet.java:231)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      at java.lang.Thread.run(Thread.java:745)

Getting the error above when trying to get Web Element value using element attribute. Issue started a couple of weeks ago and seems to be affecting Chrome only, works fine in Firefox. See the image for further reference.

Hello @gstoyanova,

Did you try to increase timeout for this action? Or add additional Wait before using WebElement?

Yes, used up to 5000 ms with the same result: script times out. The script does not time out when “Use element attribute” is unchecked.

I just noticed the initial description of the issue is buried under the error code. The issue does not occur when I run the script with Firefox.

Thank you for clarification. Are you sure that page is completely loaded before this action? Can you click on this element by XPath?

I am sure because before scraping the section the xpath represents, the scripts successfully scrapes other elements on the same page. Again, the issue does not occur in Firefox. The xpath technically works in Chrome as well when “Use element attribute” is unchecked.

Can you please share your XPath (and page if possible)? And please clarify what attribute you set when “Use element attribute” is checked.
Thank you.

You can see the page URL in the screenshot too.

Hi @gstoyanova,

I checked with the latest version 2.4.0 in 2 browsers (Firefox and Chrome) and all worked as expected. Can you please advise your version? You can check in Control Panel - Programs and Features.

Hey Lera, I’m still running 2.3.0. Upgrading to the latest version is not an option for me at this time.

I checked with version 2.3.0 running script from Studio and couldn’t reproduce your issue. Can you please advise how long your script works? Maybe, additional Wait action will help.

Hello @gstoyanova,

Do you still need assistance with this issue?

Yes, the issue is still there. I didn’t quite get the question about how long my script works. Additional wait time does not help. The fact that element attribute capture works fine in Firefox suggests that the problem lies with how the scripts interacts with Chrome.

Thanks. Agree that it looks like the issue is with the browser. Could you please also advise your Chrome version? I checked in 77.0.3865.120 (64-bit).

Hi @Lera, I was wondering if there is a custom script I can use to increase the chromedriver implicit wait. The issue I’m having is also happening while testing in Control Tower, so it’s not just locally on my machine. I’ve come across certain statements I could use but not quite sure how to incorporate them in my script. I dropped the idea of reinstalling Chrome since obviously that would not change the default implicit wait of 0 ms and, per the error message I get, it seems that’s what’s causing the script to time out. Thanks for your help!

Hi @gstoyanova.

Sorry for the delay. I’m not sure that custom script can help to increase Chromedriver wait timeout. If I find something, will share with you.

1 Like