Validate.NotExists() throws Element.NotFoundException. : Automation API

Validate.NotExists() throws Element.NotFoundException.

Class library usage, coding and language questions.

Validate.NotExists() throws Element.NotFoundException.

Postby odd » Wed Apr 13, 2011 4:51 pm

During execution the following code when "Interface.Chicago.Instance.Client.Main.Self" window is not exists,
Code: Select all
try
{
Validate.NotExists(Interface.Chicago.Instance.Client.Main.Self, "Comment.", false);
}

catch (RanorexException e)
{
Report.Error(e.ToString());
}

Ranorex throws Element.NotFoundException, which is catched in catch block, so there is no any validation fail message in log, but only exception.

Ranorex version is 3.0.0.11639.
User avatar
odd
 
Posts: 17
Joined: Fri Mar 11, 2011 10:37 am

Re: Validate.NotExists() throws Element.NotFoundException.

Postby Support Team » Wed Apr 13, 2011 5:08 pm

You have to use the corresponding "SelfInfo" object instead of the "Self" property. See the following forum threads for more info:
behavior-of-nonexists-method-t1826.html#p6824
what-s-a-repoiteminfo-and-how-do-you-use-it-t1263.html#p4558

Regards,
Alex
Ranorex Team
User avatar
Support Team
Site Admin
 
Posts: 4845
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria

Re: Validate.NotExists() throws Element.NotFoundException.

Postby odd » Thu Apr 14, 2011 9:35 am

Thank you. This solves my issue.
User avatar
odd
 
Posts: 17
Joined: Fri Mar 11, 2011 10:37 am


Return to Automation API

Who is online

Users browsing this forum: No registered users and 0 guests

cron