Error Executing Keyboard Action

I’m trying to work through what I think to be a very simple bot, but it is taken me almost all day, and I have only gotten halfway through it.

What I want this bot to do is download an .xlsb file from a website then convert the .xlsb to .xlsx.

I want this bot to run periodically so that this data can be referenced to other datasets for dashboarding purposes.

Where I’m stuck is that when I download the file from the website, I want to ensure to save it with a consistent name, so I want to use the Enter Keystrokes activity, but I am getting “Error executing KeyboardAction”. I am on RPA 2.2. I don’t need to “Launch Application” so I think, because the downloading the file from the website automatically opens Excel, so the advice on disabling “Autodetect window” does not apply.

Can someone please help? Thanks,

Bill

Hi @billhodde can you share the text of the error and the screenshot of the Actions flow (with details of the action that fails) or your recording file?

Here is the screenshot of the error:

Can you click Details>>, copy the error text and share here?

As you work with a website you can use Web element action to paste / copy text rather than Keystrokes.

Error executing KeyboardAction
  com.workfusion.studio.rpa.recorder.playback.PlaybackException: Error executing TemplateAction[templateName=KeyboardAction.ftl,id=12,name=Optional[KeyboardAction],parent=-1,nextSibling=13,arguments=ActionArguments[delay=[100],xsi:type=[recorder:KeyboardAction, recorder:KeyboardAction],pollingInterval=[300],active=[true],actionDetails=[(typed text)],text=[North American Rotary Rig Count Pivot Table (Feb 2011 - Current)],type=[KEY_TYPE],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: org.openqa.selenium.NoSuchElementException: Element "" doesn't exist on the window 'com.workfusion.autoit.driver.DesktopWindow@7f1ae06'.
For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html
Build info: version: '9.2.0.4', revision: '1a10eeeced', time: '2018-11-29T10:44:59.891Z'
System info: host: 'AHP-3Q3WLQ2', ip: '192.168.1.50', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_121'
Driver info: driver.version: unknown
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.RemoteExecuteMethod.execute(RemoteExecuteMethod.java:35)
      at org.openqa.selenium.remote.RemoteKeyboard.sendKeys(RemoteKeyboard.java:38)
      at com.workfusion.rpa.helpers.RobotsKeyboard.sendKeys(RobotsKeyboard.java:49)
      at com.workfusion.rpa.helpers.RPA.sendKeys(RPA.java:282)
      at com.workfusion.rpa.helpers.RPA$sendKeys$5.callStatic(Unknown Source)
      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 Script12$_run_closure1.doCall(Script12.groovy:10)
      at Script12$_run_closure1.doCall(Script12.groovy)
      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 groovy.lang.Closure.call(Closure.java:415)
      at com.workfusion.rpa.helpers.RPA.inDesktop(RPA.java:670)
      at com.workfusion.rpa.helpers.RPA$inDesktop$4.callStatic(Unknown Source)
      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 Script12.run(Script12.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.NoSuchElementException: Element "" doesn't exist on the window 'com.workfusion.autoit.driver.DesktopWindow@7f1ae06'.
For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html
Build info: version: '9.2.0.4', revision: '1a10eeeced', time: '2018-11-29T10:44:59.891Z'
System info: host: 'AHP-3Q3WLQ2', ip: '192.168.1.50', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_121'
Driver info: driver.version: unknown
For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html
Build info: version: '9.2.0.4', revision: '1a10eeeced', time: '2018-11-29T10:44:59.891Z'
System info: host: 'AHP-3Q3WLQ2', ip: '192.168.1.50', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_121'
Driver info: driver.version: unknown
      at com.workfusion.autoit.driver.KeyboardManager.throwExceptionIfNotExists(KeyboardManager.java:62)
      at com.workfusion.autoit.driver.KeyboardManager.typeInActiveWindow(KeyboardManager.java:52)
      at com.workfusion.autoit.driver.KeyboardManager.sendKeys(KeyboardManager.java:27)
      at org.openqa.selenium.remote.server.handler.interactions.SendKeyToActiveElement.resolve(SendKeyToActiveElement.java:64)
      at org.openqa.selenium.remote.server.handler.interactions.SendKeyToActiveElement.lambda$call$0(SendKeyToActiveElement.java:48)
      at org.openqa.selenium.remote.server.handler.interactions.SendKeyToActiveElement.call(SendKeyToActiveElement.java:54)
      at org.openqa.selenium.remote.server.handler.interactions.SendKeyToActiveElement.call(SendKeyToActiveElement.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: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)

Thank you @billhodde are you able to get XPaths of the elements on the page?

In this case, you can use web elements and click on Xpaths in your script - it should solve the issue.

Note that all actions you perform on the page have to be nested inside the Open website action.

1 Like