Typical situation for (web)UI automation is a need to synchronize pages flow with “robot” workflow. Typical implementation is a wait for answer after search or other actions which results in page change.
but they are mainly static and all seems to be not enough for that task.
The most effective in many cases is just a long “timeout”, but this have a drastic impact on the performance.
I tried to use “check-that-an-element-exists”, but it is effective when element really exists. I need to check “check-that-an-element-does-not-exists” and wait for its appearance. It needs a repetitive run of get_element activity.
I tried to use construction with “while” like on the screen, but I am not able to define (type?) element returned by nm.get_element.
This is exactly what I mentioned to do…
My problem is, that I am not familiar with data/objects model of this environment and do not know type of variable, which I have to declare for “while” and “elements” parameter.
You don’t need loop for that.
Get Element will try and get the element if it was not found it will re try until the value in Timeout has passed.
If instead want check that an item goes away, use Get Element to find it, and then use
I used this approach always when I expected quite long and unpredictable time of operation (even 15s - mainly “search”). However, I observe different behaviour, workflow always wait up to the “timeout” value and when it passed, try to do next step, if the element appeared.
This prompted me to consider the loop.
Kind regards,
Andy
PS. Sorry for the fork… Could you tell me how to declare variable for “elements” parameter? When I create one of NMElement type I got the compile error “Cannot convert value of type OpenRPA.NM.NMElement to one dimension array of OpenRPA.NM.NMElement elements”. Message is not exactly in that I presented as OS is not english and openRPA speaks to me in my native language… :\
Delete the variable, go to the field, and type the name you want for a variable then pres Ctrl+K to auto create one of the correct type. Elements is the RESULT of the get element, this variable will contain all the found results once you get past the Get Element ( NEVER use that inside an Get Element ! )