Mouse click by image (or) wait for image error

Hi,

We have developed the script with a mouse click by image, which was executed successfully for several times. But all of a sudden the script is throwing an error on each mouse click by an image.

We have tried to install RPA Express 2.0 and found all the keystrokes were failed wherever it uses WIN + r combination. So we have reverted the software version to 1.4.

Please suggest why we are getting an error on mouse click which was worked perfectly.

@anandhan it is hard to tell. Try increasing timeouts in the mouse click actions. Does it help?

image

Increased the timeout, still no luck. Is there any limitation for mouse click by image?

Please check the error log details. What error does it show (the Caused by: part) ?

I used exception block for the entire process, hence it’s not possible to get the error message.

Is there is a way to get the detailed error message(like stack trace) that is thrown inside the exception block?

The below error stopped the script execution. Have captured the image for many times and increased timeout also, but no luck. Still, the below show stopper stopped further execution. Please suggest the solution

@anandhan thank you. Could you also share a screenshot of the action itself (step 182)?

Please find the screenshot. Please explain why the mouse click by image & wait for image actions are not working as expected.

Error executing WaitForImageAction
  com.workfusion.studio.rpa.recorder.playback.PlaybackException: Error executing TemplateAction[templateName=WaitForImageAction.ftl,id=182,name=Optional[WaitForImageAction],parent=181,nextSibling=183,arguments=ActionArguments[varName=[app_bool_java_error],delay=[10000],imageName=[D:\\Anand\\References\\RPA\\Projects WorkFusion\\Avatar_Account\\Avatar\\1527256298477-anchor.apng],fullImageName=[1527256257161.png],xsi:type=[recorder:WaitForImageAction, recorder:WaitForImageAction],pollingInterval=[300],active=[true],actionDetails=[(0 ms)],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:30)
      at com.workfusion.studio.rpa.recorder.playback.action.template.TemplateAction.execute(TemplateAction.java:17)
      at com.workfusion.studio.rpa.recorder.playback.player.ActionPlayer.next(ActionPlayer.java:53)
      at com.workfusion.studio.rpa.recorder.player.PlaybackLogic.playNextAction(PlaybackLogic.java:153)
      at com.workfusion.studio.rpa.recorder.player.PlaybackLogic.run(PlaybackLogic.java:113)
      at java.lang.Thread.run(Thread.java:745)
  Caused by: java.lang.IllegalStateException: Unable to process template with name: WaitForImageAction.ftl
      at com.workfusion.studio.rpa.recorder.freemarker.FreemarkerTemplateProcessor.process(FreemarkerTemplateProcessor.java:95)
      at com.workfusion.studio.rpa.recorder.playback.action.template.TemplateAction.executeBehavior(TemplateAction.java:35)
      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:30)
      at com.workfusion.studio.rpa.recorder.playback.action.template.TemplateAction.execute(TemplateAction.java:17)
      at com.workfusion.studio.rpa.recorder.playback.player.ActionPlayer.next(ActionPlayer.java:53)
      at com.workfusion.studio.rpa.recorder.player.PlaybackLogic.playNextAction(PlaybackLogic.java:153)
      at com.workfusion.studio.rpa.recorder.player.PlaybackLogic.run(PlaybackLogic.java:113)
      at java.lang.Thread.run(Thread.java:745)
  Caused by: freemarker.core.InvalidReferenceException: The following has evaluated to null or missing:
==> waitTimeout  [in template "WaitForImageAction.ftl" at line 6, column 53]

----
Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??
----

----
FTL stack trace ("~" means nesting-related):
	- Failed at: ${waitTimeout}  [in template "WaitForImageAction.ftl" at line 6, column 51]
----
      at freemarker.core.InvalidReferenceException.getInstance(InvalidReferenceException.java:131)
      at freemarker.core.EvalUtil.coerceModelToString(EvalUtil.java:355)
      at freemarker.core.Expression.evalAndCoerceToString(Expression.java:82)
      at freemarker.core.DollarVariable.accept(DollarVariable.java:41)
      at freemarker.core.Environment.visit(Environment.java:324)
      at freemarker.core.MixedContent.accept(MixedContent.java:54)
      at freemarker.core.Environment.visitByHiddingParent(Environment.java:345)
      at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:48)
      at freemarker.core.Environment.visit(Environment.java:324)
      at freemarker.core.MixedContent.accept(MixedContent.java:54)
      at freemarker.core.Environment.visit(Environment.java:324)
      at freemarker.core.Environment.process(Environment.java:302)
      at freemarker.template.Template.process(Template.java:325)
      at com.workfusion.studio.rpa.recorder.freemarker.FreemarkerTemplateProcessor.process(FreemarkerTemplateProcessor.java:84)
      at com.workfusion.studio.rpa.recorder.playback.action.template.TemplateAction.executeBehavior(TemplateAction.java:35)
      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:30)
      at com.workfusion.studio.rpa.recorder.playback.action.template.TemplateAction.execute(TemplateAction.java:17)
      at com.workfusion.studio.rpa.recorder.playback.player.ActionPlayer.next(ActionPlayer.java:53)
      at com.workfusion.studio.rpa.recorder.player.PlaybackLogic.playNextAction(PlaybackLogic.java:153)
      at com.workfusion.studio.rpa.recorder.player.PlaybackLogic.run(PlaybackLogic.java:113)
      at java.lang.Thread.run(Thread.java:745)

@anandhan you didn’t set the timeout for the action, that’s why it fails. The bot doesn’t have time to look for the image.

image

It’s working now. Thanks

1 Like

@ashapkina, I Am using the wait for image option to search for folders with names P8, 2018-2018 and so on, and even in the absence of these folders, the Boolean variable is set to true.
Please help me out in this.

@swarna_m it is possible that there are some other folders in the location you search and the image recognition threshold is low, so it detects these folders as correct ones.

Instead of Wait for image, try reading the contents of the target folder to a list variable and then check if any records in the list contain the names you are looking for.