Can't find element on page after multiple loops

It seems to be something related to UI.Vision RPA 6.1.2 itself.

I run macro in a loop and I use the verifyElementPresent to see, if a specific textbox has loaded on the page and if it hasn’t it waits for 25 sec and tries to verify it again.

The anomaly is that the element is always loaded but some times, and it is during random loop, RPA can’t find the element even though it is present. It can happen during 3rd loop or during 81st.

When I pause the macro, refresh the page itself and let it run again it STILL can’t find the element. If I close the window, open a new tab… it STILL can’t pind the element. If I ctrl+shift+r it still can’t find the element.

The only thing that helps is when I fully stop the Vision RPA and then run it from the same loop round again. Then everything works again.

This makes me to believe that the problem is with the UI. Vision RPA chrome plugin itself.

How can I fix it? Is there a code that I can insert that automatically stops the macro and restarts it from the same loop cycle?

Any ways to avoid this situation from happening… why does it occur?

Thanks!

Hi, some questions:

  • Did this work with earlier version of the RPA tool?

  • Is it the same issue in Chrome and Firefox?

  • Can you provide a public test page where you see the same issue? This makes it easier for us to recreate and debug the problem.

I have not tried older versions. I am very new to RPA. Haven’t tried it with Firefox as I need chrome for this.

I can’t provide the the specific page as it is not allowed by our company and I am not able to recreate that page in a testing environment.

Are there any workarounds without sharing the page?

I can provide the code itself but I don’t think it’s of much use.

I have managed to somewhat replicate this process with the following script:

{
 "Name": "tab closing",
 "CreationDate": "2021-4-5",
 "Commands": [
      {
     "Command": "store",
     "Target": "5",
     "Value": "!timeout_wait"
   },
   {
     "Command": "open",
     "Target": "http://google.com",
     "Value": ""
   },
   {
     "Command": "selectFrame",
     "Target": "relative=top",
     "Value": ""
   },
   {
     "Command": "store",
     "Target": "true",
     "Value": "!statusOK"
   },
   {
     "Command": "verifyElementPresent",
     "Target": "xpath=//*[@id=\"login-form\"]/input[1]",
     "Value": ""
   },
   {
     "Command": "while_v2",
     "Target": "!${!statusOK}",
     "Value": ""
   },
   {
     "Command": "selectWindow",
     "Target": "tab=OPEN",
     "Value": "http://rate.ee"
   },
   {
     "Command": "selectWindow",
     "Target": "tab=CLOSEALLOTHER",
     "Value": ""
   },
   {
     "Command": "selectFrame",
     "Target": "relative=top",
     "Value": ""
   },
   {
     "Command": "verifyElementPresent",
     "Target": "xpath=//*[@id=\"login-form\"]/input[1]",
     "Value": ""
   },
   {
     "Command": "end",
     "Target": "",
     "Value": ""
   },
   {
     "Command": "click",
     "Target": "xpath=//*[@id=\"login-form\"]/input[1]",
     "Value": "",
     "Targets": [
       "name=username",
       "xpath=//*[@id=\"login-form\"]/input",
       "xpath=//input[@name='username']",
       "xpath=//input",
       "css=#login-form > input:nth-child(1)"
     ]
   },
   {
     "Command": "type",
     "Target": "xpath=//*[@id=\"login-form\"]/input[1]",
     "Value": "nimi"
   }
 ]
}

It should find the div in the new page but it doesn’t and keeps on trying to find it.

Thanks for the test macro. There the issue is that store | true | !statusOK was not in the loop. The first check always fails, since the page was not loaded yet. After that you must “reset” !statusOK. Because once it is false, !statusOK does not change back to “true” by itself.

This works:

1 Like

Thank you for this. Pretty silly of me :blush:

I’m gonna try it out on my project and see if it works there or not.