FindSingle with Flash page

Ask general questions here.
jlowder
Posts: 55
Joined: Wed Dec 30, 2009 2:56 pm

FindSingle with Flash page

Post by jlowder » Wed Dec 30, 2009 3:09 pm

Hello,

I just started using Ranorex and would like to use the FindSingle method to gain access to an object in my Flash website based on it's text caption. The objects change dynamically with each load so I'm finding use of the repository to be problematic and was hoping the FindSingle method could help. I have the following two lines:

Ranorex.FlexElement browser = Host.Local.FindSingle("/dom[@pageurl='http://localhost/RanorexLoader.swf?rxta ... derVue.swf']");
Ranorex.Text location = browser.FindSingle("/text[@caption='Parse_in.txt']");

I receive the following error when run:

Ranorex.CapabilityNotSupportedException: The element does not support the required capability 'flexelement'.
at Ranorex.Adapter.AssertRequiredCapabilities()
at Ranorex.Adapter..ctor(Element element)
at Ranorex.FlexElement.op_Implicit(Element element)
at SourceExtract.Program.Main(String[] args) in c:\QA\RanorexAutomation\Gen2\SourceExtract\SourceExtract\Program.cs:line 46

I have tried both FlexElement and FlexObject with the same result. What is the proper way to use this in this case?

Thanks,

Jason

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: FindSingle with Flash page

Post by Support Team » Sat Jan 02, 2010 6:53 pm

jlowder wrote:Ranorex.CapabilityNotSupportedException: The element does not support the required capability 'flexelement'.
That exception is thrown if the element for the path you specified does not provide the capability for the adapter you want to assign it to. Please read the following section in the Ranorex User Guide that explains Ranorex GUI adapters in detail: http://www.ranorex.com/support/user-gui ... apter.html
jlowder wrote:I have tried both FlexElement and FlexObject with the same result. What is the proper way to use this in this case?
From the path you used ("/dom[@pageurl='http://localhost/RanorexLoader.swf?rxta ... derVue.swf']"), I guess the right adapter is WebDocument. Usually, flex objects are not top-level elements, but reside inside a web document. So you need to adapt your path to get you the root of your flex application. You can easily check get that path by spying your flex application using Ranorex Spy!

Another thing I noticed in your code is that you have a "/" at the front path that should be relative:
jlowder wrote:Ranorex.Text location = browser.FindSingle("/text[@caption='Parse_in.txt']");
When you search relatively inside an element, you must not have a slash ("/") at the front of the path, otherwise Ranorex will interpret that path as an absolute one. See the following topic in the Ranorex User Guide for more info: http://www.ranorex.com/support/user-gui ... xpath.html

Regards,
Alex
Ranorex Support Team
.
Image

jlowder
Posts: 55
Joined: Wed Dec 30, 2009 2:56 pm

Re: FindSingle with Flash page

Post by jlowder » Mon Jan 04, 2010 2:21 pm

Hi Alex,

Where would one obtain a list of all the GUI adaptors?

I'll give what you suggest a shot.

Thanks,

Jason

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: FindSingle with Flash page

Post by Support Team » Mon Jan 04, 2010 3:21 pm

jlowder wrote:Where would one obtain a list of all the GUI adaptors?
When you track an element with Ranorex Spy, you see in the "General" tab all the adapters that element supports, see the corresponding section in the Ranorex User Guide:
http://www.ranorex.com/support/user-gui ... apter.html

You can find a list of all possible adapters in the API documentation when you look at the classes inheriting from the Adapter class (see http://www.ranorex.com/Documentation/Ra ... dapter.htm). However, you should not need that complete list of all adapters, since typically you are only interested in the adapters an element provides, which are shown by the "General" tab of Ranorex Spy.

Regards,
Alex
Ranorex Support Team
.
Image