Page 1 of 1

Validation Question

Posted: Fri Dec 11, 2009 10:25 pm
by ohm
Hi,

I am trying to validate if an object exits by using the following code:
Validate.Exists(repo.WebInternetExplorer.YesResultImageInfo);

In my situation the functionality might return a YesResultImage or a NoResultImage. Not anything else. How can I make Ranorex look for any of these two images. Yes/No anyone should pass the test.

Please help.
Thanks.

Re: Validation Question

Posted: Mon Dec 14, 2009 8:57 pm
by Support Team
You can, for example, use the RepoItemInfo.Exists method and check if any of the two elements exist, then pass the outcome to the Validate.IsTrue method:
Validate.IsTrue(repo.WebInternetExplorer.YesResultImageInfo.Exists() ||
    repo.WebInternetExplorer.NoResultImageInfo.Exists(),
    "None of the two elements where found.");
Regards,
Alex
Ranorex Support Team

Re: Validation Question

Posted: Tue Dec 15, 2009 5:29 pm
by ohm
Works!!
Great.
Really appreciate your help :)