Page 1 of 1

How do I get an IList of an Unknown Element?

Posted: Tue May 11, 2010 5:09 pm
by Ciege
I have a group of objects that are dicovered as an unknown element by Ranorex. I want to get an IList of those elements but am having trouble.

Using this code I get a compile error.

Code: Select all

IList<Ranorex.Core.Element> allTNewNotebookPage = HDSetupForm.FindChildren<Ranorex.Core.Element>();
Error:

Code: Select all

The type 'Ranorex.Core.Element' cannot be used as type parameter 'T' in the generic type or method 'Ranorex.Adapter.FindChildren<T>()'. There is no implicit reference conversion from 'Ranorex.Core.Element' to 'Ranorex.Adapter'.
See the attached screenshot of RanorexSpy.
Thanks.

Re: How do I get an IList of an Unknown Element?

Posted: Tue May 11, 2010 5:50 pm
by Support Team
Use Unknown instead of Element, that is the adapter corresponding to plain elements:
IList<Ranorex.Unknown> allTNewNotebookPage =
    HDSetupForm.FindChildren<Ranorex.Unknown>();
Regards,
Alex
Ranorex Support Team

Re: How do I get an IList of an Unknown Element?

Posted: Tue May 11, 2010 6:01 pm
by Ciege
Excellent. Thank you!