WaitForExists find non existing element on screen

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
hagen,mezger
Posts: 1
Joined: Wed Aug 24, 2022 11:56 am

WaitForExists find non existing element on screen

Post by hagen,mezger » Wed Aug 24, 2022 12:09 pm

I use WaitForExists to confirm an element is on screen before i proceed.
Now the method is returning true even if the element selected is not visible in the screen. This is creating a false positive in my test.

Code: Select all

vat info = ElementFinder.GetByFullPath(ciD);
try{info.WaitForExists(5000);} catch (Exception){teturen false;}
the info.WaitForExists method runs not into the error, even if the element is NOT visible.

Any idea what to do to resolve this?

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7469
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: WaitForExists find non existing element on screen

Post by odklizec » Tue Aug 30, 2022 10:16 am

Hi,

WaitForExists check the existence of an element, not its visibility on the screen! So the element may eventually be available, just not visible ;) If you want to check if the element exists and Visible, add @visible='true' to the element's xpath.

Could you please create a Ranorex snapshot of the app under test, just before calling your code? This should reveal is the element is available or not.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration