How to validate

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
omayer
Posts: 458
Joined: Thu Oct 28, 2010 6:14 pm

How to validate

Post by omayer » Sat Jul 16, 2011 1:53 am

How to validate object not found then write to report as failed. i just tried various code snippet from forum but not able to make it work.
Thank you,
Beginner

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: How to validate

Post by Support Team » Sat Jul 16, 2011 3:21 pm

Just add a "NotExists" validation in the Recorder. See following topic in the Ranorex User Guide:
http://www.ranorex.com/support/user-gui ... rding.html

Alternatively, in code you can use the Validate.NotExists method on the repository item info object as explained in the Ranorex User Guide code examples:
http://www.ranorex.com/support/user-gui ... html#c3203
The last argument (bool exceptionOnFail) of that method lets you specify whether Ranorex will throw an exception or continue execution if the validation fails.

Regards,
Alex
Ranorex Team