How do I get an IList of an Unknown Element? : General Questions

How do I get an IList of an Unknown Element?

Ask general questions here.

How do I get an IList of an Unknown Element?

Postby Ciege » Tue May 11, 2010 6:09 pm

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.
Attachments
Screenshot.jpg
RanorexSpy Screenshot
Screenshot.jpg (123.99 KiB) Viewed 350 times
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...
User avatar
Ciege
 
Posts: 965
Joined: Thu Oct 16, 2008 7:46 pm
Location: Arizona, USA

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

Postby Support Team » Tue May 11, 2010 6:50 pm

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
User avatar
Support Team
Site Admin
 
Posts: 4844
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria

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

Postby Ciege » Tue May 11, 2010 7:01 pm

Excellent. Thank you!
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...
User avatar
Ciege
 
Posts: 965
Joined: Thu Oct 16, 2008 7:46 pm
Location: Arizona, USA


Return to General Questions

Who is online

Users browsing this forum: No registered users and 1 guest