Page 1 of 1

Unable to add object 'Add Matching Children to Repository'

Posted: Mon Aug 06, 2012 2:44 pm
by Kumar
Hi,

I have scenarios were a number of check boxes will be displayed, i need to validated the list by comparing the check box names against my list (which can be in excel or from DB)

I followed the details in the below link and was able to get the objects which will be referring to all the check box which i need
http://www.ranorex.com/support/user-gui ... -mode.html

Please find the attached screenshot showing the snapshot of the Spy, but I am not able to add this object to repository. No errors are displayed but the object is also not added.

I also tried the below

Code: Select all

IList<CheckBox> list = repo.CodeListNewFormMozillaFirefox.Grouping.FindDescendants<CheckBox>;
int cnt = list.Count;
where "Grouping" is the container in which the check boxes are arranged. I get message as
"Cannot convert method group 'FindDescendants' to non-delegate type 'System.Collections.Generic.IList<Ranorex.CheckBox>'. Did you intend to invoke the method? (CS0428)"
It would be very helpful if i can get some help in finding out the correct way to do it.

Thanks & Regards,
Kumar

Re: Unable to add object 'Add Matching Children to Repository'

Posted: Mon Aug 06, 2012 3:10 pm
by Kumar
Found my mistake with the second method. I had missed ()
The below code worked:

Code: Select all

IList<CheckBox> list = repo.CodeListNewFormMozillaFirefox.Grouping.FindDescendants<CheckBox>();
int cnt = list.Count
Thanks,
Kumar

Re: Unable to add object 'Add Matching Children to Repository'

Posted: Mon Aug 06, 2012 3:37 pm
by Support Team
Hi,

I think the problem why the specific element couldn't be added is that it already exists in the repository.
From the screenshot you sent it seems that every check box has the same RxPath, did you already add one of the check boxes to the repository?

Regards,
Markus
Ranorex Support Team