It seems VerifyElementPresent is not working as advertised. From the documentation:
The difference is that verify command will verify the condition and if it does not match, it will only show an error message in log area and the macro continues to run.
However, it throws an error and stops running:
info]
Executing: | verifyElementPresent | link=ENTER ANYWAY | |
[error]
timeout reached when looking for element ‘link=ENTER ANYWAY’
[info]
Macro failed (Runtime 49.41s)
In this case, the page is waiting for audio input, and after a few seconds will display buttons based on the result. ENTER ANYWAY is one possibility. If it doesn’t exist, I want the algorithm to continue.
=> Can you send me a test case where the macro stops?
In general if you want to avoid that a macro stops because of an error, you can set the !errorignore internal variable to true (and back to false once the sequence of commands where you want to ignore errors is over):
Totally agree! And this is how it works in my test macro above (macro continues). => Can you create the issue with verifyElementPresent on a (similar?) public page? Then we can debut the issue and fix it.
I just tested your macro - and it works just fine => I tested in Chrome and Firefox, just to be sure. Below is a screenshot. Very strange… now I have no idea why it would not work for you. If you have any additional ideas or test cases, please let me know.
I have the same exact problem. I created a script and it worked awesome for a while, ran through the loop a couple hundred times. Now I can’t get it to run at all. Everytime it hits the verifyElementPresent it times out and then errors and the script stops. It doesn’t even get to the next line to check if the lastcommandok it stops where before it would continue and say error ignored in the log… this seems broken… can’t get it to work anymore…
I was able to bypass this problem and get the script to continue working by setting the variable !errorignore to false first as mentioned earlier in this thread using the store command. It’s a pain in the ass though but it’s working now.
unrelated to this problem I had other bugs where the script worked fine for many times in the loop but then would fail randomly on different steps. I found that one issue is the clickandwait command is not reliable and works sometimes but fails frequently. One thing to get the script to run more reliably is to switch to the click command and include a manual pause… kind of lame it’s not reliable. Another issue with the waitforpagetoload command. not reliable and fails sometimes, randomly. switch to a manual pause and hope the page loads in time is more reliable. also tweaking the command max execution time to 20 or 30 seconds can help…
i guess this thing isn’t perfect but there are some work arounds…
I am having a similar issue, seemingly at random. Most of the time, the check works just fine, but every now and then when it fails to find the element, it goes to the next line (an if checking to see if LASTCOMMANDOK is true) and times out.
Just ran into the same bug and I’m on v5.2.3. If it helps I was using the element id=login in which it would throw an error and stop running. When I switched the element to text, it works as expected.
@admin@TechSupport am also getting this same issue. The script is getting failed at verifyElementPresent step if the element is not present. Could you please provide any solution for this as this is show stopper now for most people like me and our test suites are unable to run.
@admin
To followup this is still occurring. I’m now on v5.3.8 using Chrome. I can run a macro back to back with no changes and it will ignore like it’s supposed to one time and not the next. You can clearly see sometimes it works like assert: