What's a better way to check if something DOESN'T exist on a page?

As an example I have an automation that simply takes rows from a table on a web page and uses their data to process updates in another system.

One of the things I need to do is make sure for the request on the web page that a certain element does NOT exist. If it does exist then we have to reject the request.

Using Check App State works, but because the web page can be slow sometimes we have to use a 30 second timeout. Couple that with the fact that the element usually won’t exist, and it’s a huge time waster sitting for 30 seconds for every request.

So what’s a better way to check if something doesn’t exist on a page? Maybe we need an “Element Does Not Exist” Activity to complement “Element Exists…”

1 Like

Hey @postwick

First use element exist to find a constant element to confirm the page load.

Once that is done you may use the element exist or check app with 3s or less delay.

Hope this helps.

Thanks
#nK

1 Like

Yeah I was hoping for a more tidy solution but that may be the way we have to go, with an extra step to check for something that will exist before checking for the thing that usually won’t.

1 Like

Yep @postwick

You can use Check App State - Element to disappear option pls…

Hope this helps.

#nK

That won’t work. In order to wait for something to disappear it first has to exist. That’s not what’s happening here.

1 Like

If you have a page load and then to check for the element not present the check app state should help…

#nK

You can try using Pick activity and add 2 Pick branches. In the first branch’s trigger scope, put element exist activity for the one that might not exist. The other branch, the one that always exists. It will always pick the first branch if both elements are exist or not (thus, beware if both elements are not exist, an exception handling need to be added).