CV Element Exists returns TRUE even when element doesn't exist

Here’s a video explaining my problem:

Hi everyone. I’m new to UiPath, especially the Computer Vision Module. I’ve made a simple workflow shown in the image above (this is the full workflow). I’m checking whether a button exists (using CV Element Exists), and printing the result (using Message Box). Then checking it again and printing the result. That’s it. So a total of 4 Activities inside the CV Screen Scope

The issue: Let’s say the element is initially visible and then it disappears. The first message box should say TRUE and the second should say FALSE. But in my case, it says TRUE in both cases. Basically when the workflow reaches the first message box and pauses, I manually hide the element, in order to cause the second message box to say FALSE, but it still says TRUE! It’s as if UiPath doesn’t even check again, and immediately says TRUE.

Interesting part is that it works fine the other way around, i.e. when the button is initially not there, it gives FALSE, and then when I make the button visible (while the automation is paused on the first message box), it says TRUE on the second message box. (as it should)

Eventually I want to use this workflow in a situation where I want to keep clicking on a button until it disappears, but it never returns false even when the element is not there any more.

Some additional details:

  • I’m using Studio 2025.0.161 (Community Licence)
  • I’ve tried adding delays before each activity but it didn’t help.
  • I must use the Computer Vision activities since I’m automating a Virtual Machine

@octathorn.org

Welcome to community!!

after completing first execution try to change other screen and check descriptor as well, if that text available on whole screen it will give you true value only. try to navigate other screen and execute second activity. and make that text whichever you are using in element exists that should not be available on the screen.

I’m sorry I don’t fully understand your reply. I’m not rerunning the workflow. It simply checks twice within the same workflow. I want the first one to say TRUE and the second one to say FALSE. But for some reason, UiPath immediately says TRUE even for the second one.

1st time you are checking particular element that time you are getting true because it was there in screen and at the second time also you are getting only True,

This means whatever you are indicated in CV element exists that element was able to found. at the time second CV element exists make sure other screen should be available and in that screen whatever you are indicated that text should not be available.

Do one thing after checking the first time, add any cv click activity to navigate to other screen and then let it execute for second CV element exists activity and see the result.

I’m changing the screen manually after the first check. Since i’m using CV activities, I’ve defined an area of the screen in the CV scope. So when I change the screen manually by going to a different screen in the virtual machine, that pre-defined area now doesn’t have that element, so UiPath should give FALSE.

We know that changing the screen manually does work because the workflow works fine the other way around i.e. when I first show it the screen where the element doesn’t exist, it says FALSE, then I manually change to the screen with the Element and resume the automation, it says TRUE. So screens are changing correctly.

@octathorn.org

Check the descriptor of Element exists and check the output what you exactly given in message box.

if possible after executing the first element exists can you share the screen along with element what you are trying to check.

one more thing CV scope not working exaclty based on screen it can work if the position changed. Recently i completed project that entire with CV activities. there i got to know CV will working even position changed.

Hey thank you for replying. I recorded a small video to exactly explain my problem. Can you please take a look:

Strange i am also facing same problem when i tried to automate my local applications but in VM when trying to perform actions it is working fine.

Instead of indicating only one screen try to indicate another screen as which is not actually having that text.

Try these methods if not workout raise a ticket to UiPath support team

Hi @octathorn.org,

To avoid such situations, I always use Activate window activity to bring the focus on the screen that bot is going to work on.

Also, because the screen and its elements were detected, even though you hide it, it won’t make much difference. May be try closing that window altogether if you just want to understand its behaviour.

Additionally, you can use CV hover activity before second element exists to ensure it returns true only when it’s actually visible upfront on screen.

And this behaviour is true for even normal element exists.

Hope this helps.

Regards
Sonali

I’m trying to open a ticket but it won’t let me. It’s not accepting my Licence Code for some reason. It says “error validating licence code”

I don’t think I can use Activate Window since I’m working with a virtual machine.

I’m basically working with images, not windows, i think.

I tried the CV Hover activity, but it ends up hovering over that area where the element was last time, even though it’s not there right now.

I think I need to refresh the screen somehow but there exists no such activity in the CV activities

@octathorn.org

yes you can use activate activity on VM as well.

You just need to simply give the selector of that page/element.

Regards
Sonali

Hi @octathorn.org
This behavior happens because we see that the 2 activtities are on the Same Selected CV Screen and because of that we try to optimize and don’t refresh automatically.
Can you try to change one of the CV Element Exists to a different screen, from the Selected Screen Dropdown?
image

2 Likes

You really should be working in Modern, and not using CV Screen Scope. All the CV stuff is built into the selectors for the regular activities (ie Check App State, Type Into, etc)

@octathorn.org

you can report this as bug for that follow below steps

  1. Click on New Topic in forum
  2. Then you are able to see options
  3. Fill those details
  4. Then you are navigated to fill details about the issue
  5. Provide all the info about the issue along with video recording
  6. And click on Submit.

Kindly close this topic from here by marking my post solution and follow up after raising the bug.

I tried to add a different screen to the second screen, still got the same behavior. However even if that is how UiPath behaves, it would lead to a bigger issue:

Let’s say I want to keep clicking a button until it disappears. I would add a click activity to a while loop and check the existence of the button at the end of the loop. The ‘CV Element Exists’ activity would be only used once. In that case, how will UiPath ever return a different value if it always uses the last value for optimization?

I’m actually automating a Virtual Machine. I don’t think I can use the normal selectors. E.g if I want to click, I have to use CV Click. If I want to check existence of an element, I need CV Element Exists. I tried using normal activities on the Virtual Machine, but wasn’t able to make it work. Am I doing something wrong?

(Also, I don’t have the ability to add any software on the virtual machine)

I don’t think I can use Activate Activity. All my activity is already happening in a single window which is the Virtual machine’s window. At what point would I use this activity?

The tabs that I’m changing are in the Virtual machine but the automation is running outside. From it’s perspective, it’s working with the same window. The tab changes are happening inside the window.

Please let me know if I’m thinking the correct way. Thank you

Maybe the problem is caused by “CV Screen Scope” that actualy reads the screen content and all nested activities are using this “cached” content.

Cheeers

Hmm… But if that’s the case, then why does it work perfectly when I first show it the screen where it doesn’t have that element and then I show it the screen where the element does exist. It successfully prints FALSE for the first case and TRUE for the second. If it was caching, it should print FALSE for the second case too, no?