Finding a specific sheet in an Excel workbook doesn´t work

actions_flow_s
problem_s
#1

Hi,

We are trying to “left click” a specific sheet (in this case named SHB Rådata). We have tried to use a string as you can see in the picture but it doesn´t seem to work. Can you see if we have done anything wrong?

#2

Hi @tomas.axelsson.

Could you please share full text of the exception that you received? You need to click on “Details” and expand the window with full error message.

#3

Error executing MouseClickAction
com.workfusion.studio.rpa.recorder.playback.PlaybackException: Error executing TemplateAction[templateName=MouseClickAction.ftl,id=22,name=Optional[MouseClickAction],parent=21,arguments=ActionArguments[exactMatch=[true],xsi:type=[recorder:MouseClickAction, recorder:MouseClickAction],pollingInterval=[300],active=[true],searchInFrames=[false],type=[CONTROL],button=[1],delay=[0],webElementLocatorType=[XPATH],comment=[Left klick sheet SHB Rådata],selector=[[CLASS:TabItem; NAME:SheetTab; TEXT:Sheet Tab ${sheet_name1}]],actionDetails=[(click left button)],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.WebDriverException: Element ‘[CLASS:TabItem; NAME:SheetTab; TEXT:Sheet Tab SHB Rådata]’ doesn’t exist on the window ‘[HANDLE:2820130]’ ‘[REGEXPTITLE:(?i).\QHandelsbanken kontofil\E.]’. DesktopWindow
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: ‘SEZVM4616T’, ip: ‘10.117.64.211’, os.name: ‘Windows NT (unknown)’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0_121’
Driver info: com.freedomoss.crowdcontrol.webharvest.selenium.wrapper.RemoteDriverWrapper
Capabilities [{imageSimilarityThreshold=0.8, extra.executor.id={Name=RPA Recorder}, CLOSE_ALL_WINDOWS=false, browserName=universal, javascriptEnabled=true, extra.capabilities.context={“browserType”:“universal”,“startInPrivate”:false,“blockImages”:false,“maximizeOnStartup”:false,“customCapabilities”:{“platform”:“WINDOWS”,“javascriptEnabled”:true,“SEARCH_ALL_WINDOWS”:true,“CLOSE_ALL_WINDOWS”:false,“imageSimilarityThreshold”:“0.8”},“executorId”:{“Name”:“RPA Recorder”}}, platformName=WINDOWS, SEARCH_ALL_WINDOWS=true, platform=WINDOWS}]
Session ID: b2eb9f5e-101c-4a46-be8e-4751077c4a52
*** Element info: {Using=css selector, value=[CLASS:TabItem; NAME:SheetTab; TEXT:Sheet Tab SHB Rådata]}
at sun.reflect.GeneratedConstructorAccessor170.newInstance(Unknown Source)
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.findElement(RemoteWebDriver.java:446)
at org.openqa.selenium.remote.RemoteWebDriver.findElementByCssSelector(RemoteWebDriver.java:540)
at org.openqa.selenium.By$ByCssSelector.findElement(By.java:430)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:438)
at com.workfusion.rpa.helpers.RPA.getElement(RPA.java:944)
at com.workfusion.rpa.helpers.RPA.$(RPA.java:864)
at com.workfusion.rpa.helpers.RPA.$(RPA.java:852)
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.callsite.StaticMetaMethodSite$StaticMetaMethodSiteNoUnwrap.invoke(StaticMetaMethodSite.java:133)
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 Script23$_run_closure1.doCall(Script23.groovy:10)
at Script23$_run_closure1.doCall(Script23.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$0.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 Script23.run(Script23.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: java.util.NoSuchElementException: Element ‘[CLASS:TabItem; NAME:SheetTab; TEXT:Sheet Tab SHB Rådata]’ doesn’t exist on the window ‘[HANDLE:2820130]’ ‘[REGEXPTITLE:(?i).\QHandelsbanken kontofil\E.]’. DesktopWindow
at com.workfusion.autoit.driver.DesktopWindow.findElement(DesktopWindow.java:118)
at com.workfusion.autoit.driver.AutoItDriver.findElement(AutoItDriver.java:139)
at com.workfusion.universal.driver.UniversalDriver.findElement(UniversalDriver.java:80)
at org.openqa.selenium.remote.server.handler.FindElement.call(FindElement.java:48)
at org.openqa.selenium.remote.server.handler.FindElement.call(FindElement.java:33)
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)

#4

#5

Thank you. Could you please also provide full Window Control option that you received when you inspect this tab with Inspector?

#6

Hi Lera,

How do i start the inspector for this stage in the process only?

Rgds
Tomas

#7

You can inspect your Excel file out of script. Just want to know how usual Window selector looks like before you added string variable to it in your script. Also can you put this selector in your script and check how it works?

#8

#9

Can you please show the selector for Excel sheet? For example, on my screenshot it looks like [CLASS:TabItem;NAME:Sheet Sheet2].

#10

Im sorry. The “CSV” file was not the correct file. Please see new screenshot for the correct file “Handelsbanken kontofil.xlsx”

#11

Please press “Show UI Components” and check selector for the required sheet. Does it the same as in your action? Not sure, but your selector [CLASS:TabItem; NAME:SheetTab; TEXT:Sheet Tab SHB Rådata] doesn’t look the same as mine, see below in my previous post:

#12

Hi again,

Im not sure what you mean. This is what i can see in the tab “Sheet SHB Rådata”.

#13

Thanks. Please change “Type” from CSS to Object and then check the selector. You need to use it in your Mouse Click action.

#14

Hi,

I have changed from CSS to Object, but every time i go back to the Inspector it is changed back to CSS. How can i save this action?

#15

It shows CSS by default, I don’t think that it can be saved. Can you please put this Object selector to your action and check how it works?

#16

Hi again,

We have tried both selectors below and no one of them is working. It doesnt left click on the sheet we want it to. (SHB Rådata).

Please note that the first selector we used (top of thread) used to work, but not any more. So how do we get the robot to left click on sheet we want?

[CSS:.TabItem[name=“Sheet SHB Rådata”]]

#17

Could you please advise your Excel version?

#18

It is 2013

#19

One more clarification. Did you update your Windows or Office recently? You mentioned that your selector worked previously. Can you advise when it stopped work? Did this happen after update?

#20

When it worked, it was done in Excel 2016 (on local desktop). But when we moved the processes to another server it stopped working. The server is using Excel 2013.