Switch to Browser Failing (Chrome)

My recording is failing at a Switch to Browser action - using chrome. I only have one instance of an Open Website command. This is the second instance of the Switch to Browser action in my recording, the first one is set up right after the open website action and works fine.

1st instance (works):
image

2nd instance (fails):
image

Is this an issue with chrome? I know there was a recent chrome update, not sure if it’s related.
These are the error details:

Error executing SwitchToBrowserAction
  com.workfusion.studio.rpa.recorder.playback.PlaybackException: Error executing TemplateAction[templateName=SwitchToBrowserAction.ftl,id=339,name=Optional[SwitchToBrowserAction],parent=336,children=[340, 344, 347],arguments=ActionArguments[delay=[0],xsi:type=[recorder:SwitchToBrowserAction, recorder:SwitchToBrowserAction],pollingInterval=[300],active=[true],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:64)
      at com.workfusion.studio.rpa.recorder.player.PlaybackLogic.playNextAction(PlaybackLogic.java:152)
      at com.workfusion.studio.rpa.recorder.player.PlaybackLogic.run(PlaybackLogic.java:112)
      at java.lang.Thread.run(Thread.java:745)
  Caused by: java.lang.IllegalStateException: Failed switch to browser. It might be closed in preceding actions.
      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.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:83)
      at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:105)
      at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:59)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:238)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:258)
      at Script98.run(Script98.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:65)
      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:64)
      at com.workfusion.studio.rpa.recorder.player.PlaybackLogic.playNextAction(PlaybackLogic.java:152)
      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.TimeoutException: timeout
  (Session info: chrome=72.0.3626.109)
  (Driver info: chromedriver=2.44.609538 (b655c5a60b0b544917107a59d4153d4bf78e1b90),platform=Windows NT 10.0.17134 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 0 milliseconds
Build info: version: '9.2.0.4', revision: '1a10eeeced', time: '2018-11-29T10:44:59.891Z'
System info: host: 'WILSONG4', ip: '192.168.112.20', 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 [{mobileEmulationEnabled=false, hasTouchScreen=false, platform=XP, acceptSslCerts=false, goog:chromeOptions={debuggerAddress=localhost:60312}, acceptInsecureCerts=false, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, platformName=XP, setWindowRect=true, unexpectedAlertBehaviour=ignore, applicationCacheEnabled=false, rotatable=false, networkConnectionEnabled=false, chrome={chromedriverVersion=2.44.609538 (b655c5a60b0b544917107a59d4153d4bf78e1b90), userDataDir=C:\Users\wwylie\AppData\Local\Temp\scoped_dir11684_31774}, takesHeapSnapshot=true, unhandledPromptBehavior=ignore, pageLoadStrategy=normal, databaseEnabled=false, handlesAlerts=true, version=72.0.3626.109, browserConnectionEnabled=false, nativeEvents=true, locationContextEnabled=true, cssSelectorsEnabled=true}]
Session ID: 0978cfee542fc8e15dc368d522517f5f
*** Element info: {Using=tag name, value=html}
      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.RemoteWebDriver.findElements(RemoteWebDriver.java:473)
      at org.openqa.selenium.remote.RemoteWebDriver.findElementsByTagName(RemoteWebDriver.java:520)
      at org.openqa.selenium.By$ByTagName.findElements(By.java:327)
      at org.openqa.selenium.remote.RemoteWebDriver.findElements(RemoteWebDriver.java:434)
      at com.workfusion.rpa.helpers.RPA.getElements(RPA.java:974)
      at com.workfusion.rpa.helpers.RPA.$$(RPA.java:932)
      at sun.reflect.GeneratedMethodAccessor85.invoke(Unknown Source)
      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 org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite$StaticMetaMethodSiteNoUnwrapNoCoerce.invoke(StaticMetaMethodSite.java:151)
      at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.callStatic(StaticMetaMethodSite.java:102)
      at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallStatic(CallSiteArray.java:55)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:197)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:209)
      at Script98.run(Script98.groovy:9)
      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:65)
      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:64)
      at com.workfusion.studio.rpa.recorder.player.PlaybackLogic.playNextAction(PlaybackLogic.java:152)
      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.TimeoutException: timeout
  (Session info: chrome=72.0.3626.109)
  (Driver info: chromedriver=2.44.609538 (b655c5a60b0b544917107a59d4153d4bf78e1b90),platform=Windows NT 10.0.17134 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 0 milliseconds
Build info: version: '9.2.0.4', revision: '1a10eeeced', time: '2018-11-29T10:44:59.891Z'
System info: host: 'WILSONG4', ip: '192.168.112.20', 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 [{mobileEmulationEnabled=false, hasTouchScreen=false, platform=XP, acceptSslCerts=false, goog:chromeOptions={debuggerAddress=localhost:60312}, acceptInsecureCerts=false, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, platformName=XP, setWindowRect=true, unexpectedAlertBehaviour=ignore, applicationCacheEnabled=false, rotatable=false, networkConnectionEnabled=false, chrome={chromedriverVersion=2.44.609538 (b655c5a60b0b544917107a59d4153d4bf78e1b90), userDataDir=C:\Users\wwylie\AppData\Local\Temp\scoped_dir11684_31774}, takesHeapSnapshot=true, unhandledPromptBehavior=ignore, pageLoadStrategy=normal, databaseEnabled=false, handlesAlerts=true, version=72.0.3626.109, browserConnectionEnabled=false, nativeEvents=true, locationContextEnabled=true, cssSelectorsEnabled=true}]
Session ID: 0978cfee542fc8e15dc368d522517f5f
*** Element info: {Using=tag name, value=html}
Build info: version: '9.2.0.4', revision: '1a10eeeced', time: '2018-11-29T10:44:59.891Z'
System info: host: 'WILSONG4', ip: '192.168.112.20', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_121'
Driver info: driver.version: UniversalDriver
      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.server.ActiveSessionCommandExecutor.execute(ActiveSessionCommandExecutor.java:43)
      at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:741)
      at org.openqa.selenium.remote.RemoteWebDriver.findElements(RemoteWebDriver.java:473)
      at org.openqa.selenium.remote.RemoteWebDriver.findElementsByTagName(RemoteWebDriver.java:520)
      at org.openqa.selenium.By$ByTagName.findElements(By.java:327)
      at org.openqa.selenium.remote.RemoteWebDriver.findElements(RemoteWebDriver.java:434)
      at sun.reflect.GeneratedMethodAccessor52.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at org.openqa.selenium.remote.Augmenter$CompoundHandler.intercept(Augmenter.java:189)
      at org.openqa.selenium.remote.RemoteWebDriver$$EnhancerByCGLIB$$8a1e430.findElements(<generated>)
      at com.workfusion.universal.driver.UniversalDriver.findElements(UniversalDriver.java:74)
      at org.openqa.selenium.remote.server.handler.FindElements.call(FindElements.java:50)
      at org.openqa.selenium.remote.server.handler.FindElements.call(FindElements.java:35)
      at org.openqa.selenium.remote.server.handler.WebDriverHandler.handle(WebDriverHandler.java:41)
      at org.openqa.selenium.remote.server.rest.ResultConfig.handle(ResultConfig.java:133)
      at org.openqa.selenium.remote.server.JsonHttpCommandHandler.handleRequest(JsonHttpCommandHandler.java:205)
      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)

Hi @wwylie is the browser opened at this time during the execution?

Yes, it almost seems like there’s some sort of time limit from the previous web action in order for the switch browser action to work.

@ashapkina I switched all of the web actions over to firefox and it seems to be working fine - I’m assuming this is a chrome issue, any ideas?

@wwylie we tried to reproduce from our side, and it worked correctly.

What versions of RPA Express and Chrome are you using?

@ashapkina RPA Express 2.2, Chrome Version 72.0.3626.109

Hmm, we tested it on the same versions.

Can you share your recording? If you don’t want to share on the forum, you can send it to our support team at rpaexpress@workfusion.com.

@wwylie we’ll try to reproduce this issue again. What is the time gap between the last web action and the Switch to browser action?

@ashapkina it’s about 1.5 minutes. FYI, the bot opens the browser, enters information > changes windows to a java applet, enters information > changes windows back to chrome, then fails on switch to browser command. I have updated the chrome driver file within the RPA Express folders and still now luck.