Validate.NotExists() throws Element.NotFoundException.

Class library usage, coding and language questions.
User avatar
odd
Posts: 17
Joined: Fri Mar 11, 2011 9:37 am

Validate.NotExists() throws Element.NotFoundException.

Post by odd » Wed Apr 13, 2011 3: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
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

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

Post by Support Team » Wed Apr 13, 2011 4:08 pm

You have to use the corresponding "SelfInfo" object instead of the "Self" property. See the following forum threads for more info:
http://www.ranorex.com/forum/behavior-o ... html#p6824
http://www.ranorex.com/forum/what-s-a-r ... html#p4558

Regards,
Alex
Ranorex Team
.
Image

User avatar
odd
Posts: 17
Joined: Fri Mar 11, 2011 9:37 am

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

Post by odd » Thu Apr 14, 2011 8:35 am

Thank you. This solves my issue.