Elelment Exists fails if it doesn't find element

Hi Experts,
I am fresher in the UiPath and the RPA.

I have a simple requirement in web application. Where I have a text displaying on a webpage i.e., “Page x of y” when there are pages otherwise that text disappears. I want to get the value of y when it exists and have to do some action.
Now I see two options to achieve it.

  1. Check Element
  2. Find element

(a.) Check Element (First Option)
Now I am trying the first option check element and if I understand correctly from the documentation, it must return me true or false based on element’s existence which is not happening in my case.
If the element exists it gives me true otherwise, I see an error that “UI element doesn’t exist and make sure application is open”, obviously element is not existing that’s why I am expecting it to return false which is not happening.
Following is an example of my web app first image without “Page x of y” and the second image with “Page x of y”. It’s failing when the first example comes and works as expected in the second example.

(b.) Find element (Second Option)
I used the “Find element” to see if “Page x of y” exists. checking variable pageTextExists which is the output of find element activity with pageTextExists IsNot Nothing and assigning this value to another boolean variable. However, I am always getting true in this case.

Following is the screenshot of process for your reference:

Really appreciate your help guys

@RoboMan Did you Try “Check up state” activity
This will give you True if element exist and if element not exist it will return false

@RoboMan In check up sate if condition is by default included their is no need to put extra if to check the variable value. Try this one and pretty sure you will get your solution.

Ok Thank you Raja, Let me check. and thank you for instant reply.

1 Like

yes check it and here is one thing timout, its by default timeout is 5 sec and you can increase it as well.

Thank you, this worked. And yes, I checked all valuable properties.

1 Like

@RoboMan great. Happy automation.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.