verifyElementPresent isn't being accepted in UI.Vision macro

I enter command verifyElementPresent but when I go to the target field it replaces it with verify.

Why can’t I use verifyElementPresent?

The command used to be verify, but that does not work to verify if an image is present, so I tried to switch to verifyElementPresent. I’m doing this in table view if that matters.

Hi, do you have a test macro for us that shows the issue?

This is a piece of it:

The goal is to see if a Warning image exists. If it does the while loop will be executed again. If it doesn’t exist, exit the while loop.

{
“Command”: “XDesktopAutomation”,
“Target”: “True”,
“Value”: “”,
“Description”: “Working with pop-up window.”
},

{
  "Command": "store",
  "Target": "!ErrorIgnore",
  "Value": "True",
  "Description": ""
},
{
  "Command": "verify",
  "Target": "find_severity_clickonwarning_dpi_96.png",
  "Value": "",
  "Description": "See if another Warning exists."
},

When I try to change verify to verifyElementPresent and click in another field (table mode) verifyElementPresent is replaced by verify.

It would be nice if I could use While “find_severity_clickonwarning_dpi_96.png” image exists, continue the while loop, otherwise End the while loop.

I was able to go to json view and enter verifyElementPresent and it remained when I went back to table view.

However, even though I am in desktop mode, it cannot find the image (in pop-up window) even though I am desktop mode:

  • info]

    Executing:  | verifyElementPresent | find_severity_clickonwarning_dpi_96.png |  | 
    
  • [error][ignored]

Line 11: ‘find_severity_clickonwarning_dpi_96.png’ element not present.

I tried to use the “Find” button for that command and it pops up E:219 DOM not found, and this shows up at the top of the Edge page, so it seems to be ignoring the Desktop mode (for Find).

Ah, I see the issue now. verifyElementPresent is only for web HTML elements. The command needs an XPath as input.

To verify that an image exists use visualVerify.

visualVerify worked.

Thank you!

It would be nice if the documentation for each command says if it works for desktop mode.

1 Like