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
FindSingle with Flash page
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: FindSingle with Flash page
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.htmljlowder wrote:Ranorex.CapabilityNotSupportedException: The element does not support the required capability 'flexelement'.
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!jlowder wrote:I have tried both FlexElement and FlexObject with the same result. What is the proper way to use this in this case?
Another thing I noticed in your code is that you have a "/" at the front path that should be relative:
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.htmljlowder wrote:Ranorex.Text location = browser.FindSingle("/text[@caption='Parse_in.txt']");
Regards,
Alex
Ranorex Support Team
Re: FindSingle with Flash page
Hi Alex,
Where would one obtain a list of all the GUI adaptors?
I'll give what you suggest a shot.
Thanks,
Jason
Where would one obtain a list of all the GUI adaptors?
I'll give what you suggest a shot.
Thanks,
Jason
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: FindSingle with Flash page
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:jlowder wrote:Where would one obtain a list of all the GUI adaptors?
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