List Adaptor throws exception for Telerik ListControl

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
JohnWashburn
Posts: 54
Joined: Wed Jan 09, 2013 7:02 pm

List Adaptor throws exception for Telerik ListControl

Post by JohnWashburn » Mon Apr 15, 2013 10:43 pm

I have a Winform application which has a Telerik ListControl containing 100 elements.

The list adaptor for this object executes the following calls to the adaptor interface:
// finds the control by Rx object path
controlFound = Host.Local.FindSingle<Ranorex.List>(path, ranorexTimeout);

// walks the list of items for the item name sought with:
if (currListItem.Text.Equals(name))

// with the index found with the walk over the names the adaptor fails on
controlFound.SelectedItemIndex = index;

With the exception:

Ranorex.SetAttributeFailedException: Setting attribute 'selecteditemindex' failed on element '{List:radListControl1}'. ---> System.NotSupportedException: The operation is not supported.
at Ranorex.Plugin.MsaaFlavorElement.SetAttributeValue(Element element, String name, Object value)
at Ranorex.Core.Element.SetAttributeValue(String name, Object value)
--- End of inner exception stack trace ---
at Ranorex.Core.Element.SetAttributeValue(String name, Object value)
at Ranorex.List.set_SelectedItemIndex(Int32 value)
at Cognex.TA.Action.Winform.ListActions.SelectItem(Dictionary`2 properties, Dictionary`2 state, StringBuilder resultsString)

How is setting the currently selected item of a ListControl not a supported operation of the list adaptor?

What exactly is the code:
controlFound.SelectedItemIndex = index;
doing that the List Adaptor thinks the Telerik ListControl does not support selecting an item from the list?

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: List Adaptor throws exception for Telerik ListControl

Post by Support Team » Tue Apr 16, 2013 3:28 pm

Hello,

Unfortunately it's not possible to invoke the .Select methods of MSAA elements, because it is simply not supported by MSAA.
Please take a look at the post "Using "Select" method in a text box".
A similar issue was discussed there.

Regards,
Bernhard

JohnWashburn
Posts: 54
Joined: Wed Jan 09, 2013 7:02 pm

Re: List Adaptor throws exception for Telerik ListControl

Post by JohnWashburn » Wed Apr 17, 2013 8:27 pm

And support of the the UI Automation elements of a Winform application will begin when?

JohnWashburn
Posts: 54
Joined: Wed Jan 09, 2013 7:02 pm

Re: List Adaptor throws exception for Telerik ListControl

Post by JohnWashburn » Wed Apr 17, 2013 10:36 pm

I can set the text for Telerik controls via the Text Adapter. Is this because the Text Adapter is "flowing" around the MSAA accessibility interface to the underlying text control?

Let me do some more research on which setters for which controls work and which do not.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: List Adaptor throws exception for Telerik ListControl

Post by Support Team » Thu Apr 18, 2013 8:43 am

JohnWashburn wrote:And support of the the UI Automation elements of a Winform application will begin when?
As I just explained in this posting, the better alternative is using the Control element for that WinForms control instead of the corresponding MSAA element. The Control element in Ranorex supports much more functionality than MSAA and even UIA.
Just change your RanoreXPath and delete the last step/level so the parent element of the MSAA element is used (should be a Control element).

Regards,
Alex
Ranorex Team

JohnWashburn
Posts: 54
Joined: Wed Jan 09, 2013 7:02 pm

Re: List Adaptor throws exception for Telerik ListControl

Post by JohnWashburn » Thu Apr 18, 2013 3:41 pm

First, off our controls do not use MSAA. But the controls are derived from the Telerik library. There is no winform control exposed. Only the the UI Automation element managed by the Telerik library for this piece of screen real estate is exposed. the Telerik control libraries make heavy use of virtualization so there is no control there most of the time, just a virtualization of the control.

I understand the MSAA-UIA bridge poses problems. Is there a change we can make to our winform application in order to inform Ranorex that the application has native support for UIA and, thus, use that accessibility channel for communication?

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: List Adaptor throws exception for Telerik ListControl

Post by Support Team » Thu Apr 18, 2013 4:11 pm

JohnWashburn wrote: Is there a change we can make to our winform application in order to inform Ranorex that the application has native support for UIA and, thus, use that accessibility channel for communication?
UPDATE: Ranorex 4.1.0 will have a setting for the WPF plugin to turn on UIA element generation for windows/controls natively implementing UIA. For more information see following forum post:
http://www.ranorex.com/forum/using-sele ... tml#p19504
JohnWashburn wrote:There is no winform control exposed. Only the the UI Automation element managed by the Telerik library for this piece of screen real estate is exposed
I'm not sure that I completely understand that set-up. Could you post a Ranorex snapshot of the application (or send it to our support email address), so we could check for options? Thanks!

Regards,
Alex
Ranorex Team
Last edited by Support Team on Fri Apr 26, 2013 8:54 am, edited 1 time in total.
Reason: UPDATE

JohnWashburn
Posts: 54
Joined: Wed Jan 09, 2013 7:02 pm

Re: List Adaptor throws exception for Telerik ListControl

Post by JohnWashburn » Mon Apr 29, 2013 6:20 pm

I have uploaded via FTP the snapshot requested.

I also included a copy an application under test (TelerikWhetstone) which uses Telerik list control
and
a Visual Studio 2010 solution for C# automation code that drives the automation of the TelerikWhetstone application via the Ranorex runtime.

Telerik is adamant that the problem is that Ranorex does not properly interacting with the accessibility object associated with the virtualized list object.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: List Adaptor throws exception for Telerik ListControl

Post by Support Team » Tue Apr 30, 2013 1:05 pm

JohnWashburn wrote:First, off our controls do not use MSAA. But the controls are derived from the Telerik library. There is no winform control exposed.
Hmm, my findings are different. All the controls in your sample app are WinForms controls, all implementing MSAA. So nothing special there, no need wait for Ranorex 4.1.0 (also see my post in the associated forum thread).

As explained in my original answer to the problem, you just have to use the correct element to set the "SelectedItemIndex" attribute on. That is the parent element of the MSAA element you are currently using (RanoreXPath ".//container[@controlname='radListControl1']").
Alternatively, you can also call the "Select" action on the individual list items in order to select them. Both ways worked out of the box with the sample app.

Regards,
Alex
Ranorex Team