Element Exists returns true even if it is not there in the foreground

Dear Friends,

I have a situation where I need to take a decision on a certain element if it appears on the screen (highlighted in screen shot).

I used the Element exists activity and it always return TRUE, I believe that the element exists in the background that is the reason it returns back true always.

How do I address this issue, any thoughts would be highly appreciated.

Regards,
Manjesh

Try with Image Exists once

1 Like

Hi @manjesh_kumar

Yes you are correct the Element Exists works even if element is not visible, If you want to check if the element is visible and then you can use Get attribute activity and you can use visibility option or fore ground option

Try these two options and let me know
If you are using foreground option then the output variable type should be boolean
image

If you are using Visibility option output variable type should be integer type (result will be of type 0 or 1)
image

Thanks

3 Likes

Hi @manjesh_kumar

You can also use Text Exist Activity

  1. Need to select the whole region below the Invoice number

Eg:

  1. And give the Exact Text you need to find (It is case sensitive and will return boolean value )
    Eg:

Just Give it a try and let me know

1 Like

In most of the cases Visiblity is not working but relativeVisibility attribute is triggering the display status. Just check it e.g. within UiExplorer (as you also can identify the hidden but existing element there)

1 Like

Hello @manjesh_kumar
if element always exist then I would recommned to check the attributes of that element. Attribute like IsVisible or Foreground etc. Get the value of this attrribute to check the visibility of the element and proceed further.

2 Likes

Hi @manjesh_kumar

you can use get attribute method or Text exists activities

1 Like

Hello Peter,

Thank you for the hint, yep somehow the visibility attribute did not work.

I have used the Text exist and as well as Image exists and that solved my issue.

Thank you all other members for your input.

Thanks.

in some other cases it was triggeed by some parent elements like here:

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