How to check if element isn't shown?

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
WajdaW
Posts: 75
Joined: Wed Jan 05, 2011 6:45 pm

How to check if element isn't shown?

Post by WajdaW » Wed Jun 01, 2011 6:03 pm

I have situation where I need to check if element isn't found.
It comes to my mind to Search for this element and catch TimeOutException
try
{
FindSingle(element, timeout);
}
catch
{
// element isn't there
}

So is this only way or is there some better way to do this?

regards,

Vladimir Vajda

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: How to check if element isn't shown?

Post by Support Team » Wed Jun 01, 2011 7:48 pm

Hello Vladimir,

there is
validate.NotExists()
which internally does exactly that.

Regards,
Roland
Ranorex Support Team
.
Image

WajdaW
Posts: 75
Joined: Wed Jan 05, 2011 6:45 pm

Re: How to check if element isn't shown?

Post by WajdaW » Thu Jun 02, 2011 10:38 am

Thanks, Roland.

Regards,

Vladimir Vajda