Issue recognizing object in VB script app

Ranorex Studio, Spy, Recorder, and Driver.
SeanP
Posts: 60
Joined: Wed Sep 01, 2010 11:48 pm
Location: Irvine California

Issue recognizing object in VB script app

Post by SeanP » Fri Oct 19, 2012 8:44 pm

I have an upgrade application where Ranorex is struggling recognize a group of radio buttons on the form. However it easily finds the form itself.

Also when i click highlight in studio or spy, the whole form becomes topmost. However when i search for the radio button groups (look at model as an example), Ranorex is endlessly searching. The object is only found when I manually bring the form to the top and give it focus. As a side effect, this is causing my playbacks to fail.

I have attached the snapshot and a screenshot in a zip for your review.
You do not have the required permissions to view the files attached to this post.

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

Re: Issue recognizing object in VB script app

Post by Support Team » Mon Oct 22, 2012 11:09 am

Hello,

Buttons are identified differently according to your snapshot:
'PowerFusion HL1' and 'PowerFusionHL2' are identified correctly but all other buttons are only identified as an element. Are there always the same elements which are not found?

You could add an action 'Ensure Visible' for the buttongroup to your recording in order to enforce visibility.

Regards,
Markus (T)
Support Team

SeanP
Posts: 60
Joined: Wed Sep 01, 2010 11:48 pm
Location: Irvine California

Re: Issue recognizing object in VB script app

Post by SeanP » Mon Oct 22, 2012 6:51 pm

Yes, those two are typically found and the rest are not. Code wise they are all implemented the same. The repository was generated in 3.0.5.

I did an ensurevisible = true on ElementNGB_Upgrade_2b1 and the objects are still failing to find in Ranorex Studio with the application behind Ranorex Studio.

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

Re: Issue recognizing object in VB script app

Post by Support Team » Tue Oct 23, 2012 12:33 pm

Hello,

Did it work with Ranorex version 3.0.5?

Is it possible to identify the elements with AccExplorer or Inspect?

Regards,
Markus (T)
Support Team

SeanP
Posts: 60
Joined: Wed Sep 01, 2010 11:48 pm
Location: Irvine California

Re: Issue recognizing object in VB script app

Post by SeanP » Tue Oct 23, 2012 5:54 pm

Here is the inspect on the group of radio buttons:

IsKeyboardFocusable: true
IsEnabled: true
AutomationId: "2360936"
ClassName: "TVDSRadio"
HelpText: ""
IsPassword: false
NativeWindowHandle: 0x240668
IsOffscreen: false
FrameworkId: "Win32"
ProviderDescription: "[pid:7684,hwnd:0x240668 Main:Nested [pid:6988,hwnd:0x240668 Annotation(parent link):Microsoft: Annotation Proxy (unmanaged:uiautomationcore.dll); Main:Microsoft: MSAA Proxy (unmanaged:uiautomationcore.dll)]; Hwnd(parent link):Microsoft: HWND Proxy (unmanaged:uiautomationcore.dll)]"
LegacyIAccessible.ChildId: 0
LegacyIAccessible.DefaultAction: ""
LegacyIAccessible.Description: ""
LegacyIAccessible.Help: ""
LegacyIAccessible.KeyboardShortcut: ""
LegacyIAccessible.Name: "Model"
LegacyIAccessible.Role: client (0xA)
LegacyIAccessible.State: focusable (0x100000)
LegacyIAccessible.Value: ""
IsDockPatternAvailable: false
IsExpandCollapsePatternAvailable: false
IsGridItemPatternAvailable: false
IsGridPatternAvailable: false
IsInvokePatternAvailable: false
IsLegacyIAccessiblePatternAvailable: true
IsMultipleViewPatternAvailable: false
IsRangeValuePatternAvailable: false
IsScrollPatternAvailable: false
IsScrollItemPatternAvailable: false
IsSelectionItemPatternAvailable: false
IsSelectionPatternAvailable: false
IsTablePatternAvailable: false
IsTableItemPatternAvailable: false
IsTextPatternAvailable: false
IsTogglePatternAvailable: false
IsTransformPatternAvailable: false
IsValuePatternAvailable: false
IsWindowPatternAvailable: false
IsItemContainerPatternAvailable: false
IsVirtualizedItemPatternAvailable: false
IsSynchronizedInputPatternAvailable: false
FirstChild: "PowerFusion HL2" radio button
LastChild: "3600" radio button
Next: "" status bar
Previous: [null]
Other Props: Object has no additional properties
Children: "PowerFusion HL2" radio button
"PowerFusion HL1" radio button
"PowerFusion TL2" radio button
"PowerFusion TL1" radio button
"7200 Plus HD" radio button
"7200 Plus" radio button
"7200" radio button
"7100 Plus HD" radio button
"7100 Plus" radio button
"7100" radio button
"3700 Plus" radio button
"3700 A" radio button
"3700" radio button
"3600 Plus" radio button
"3600" radio button
Ancestors: "Wirebonder Software Upgrade" window
"Desktop" pane
[ No Parent ]



Here is the inspect on just on radio button

How found: Focus
hwnd=0x00850560 32bit class="TVDSGroupBtn" style=0x54010004 ex=0x0
RuntimeId: "[42.8717664]"
BoundingRectangle: {l:673 t:493 r:792 b:508}
ProcessId: 6988
ControlType: UIA_RadioButtonControlTypeId (0xC35D)
LocalizedControlType: "radio button"
Name: "7100"
AccessKey: ""
HasKeyboardFocus: false
IsKeyboardFocusable: true
IsEnabled: true
AutomationId: "8717664"
ClassName: "TVDSGroupBtn"
HelpText: ""
IsPassword: false
NativeWindowHandle: 0x850560
IsOffscreen: false
FrameworkId: "Win32"
ProviderDescription: "[pid:7684,hwnd:0x850560 Main:Nested [pid:6988,hwnd:0x850560 Annotation(parent link):Microsoft: Annotation Proxy (unmanaged:uiautomationcore.dll); Main:Microsoft: MSAA Proxy (unmanaged:uiautomationcore.dll)]; Hwnd(parent link):Microsoft: HWND Proxy (unmanaged:uiautomationcore.dll)]"
SelectionItem.IsSelected: true
LegacyIAccessible.ChildId: 0
LegacyIAccessible.DefaultAction: "Check"
LegacyIAccessible.Description: ""
LegacyIAccessible.Help: ""
LegacyIAccessible.KeyboardShortcut: ""
LegacyIAccessible.Name: "7100"
LegacyIAccessible.Role: radio button (0x2D)
LegacyIAccessible.State: checked,focusable (0x100010)
LegacyIAccessible.Value: ""
IsDockPatternAvailable: false
IsExpandCollapsePatternAvailable: false
IsGridItemPatternAvailable: false
IsGridPatternAvailable: false
IsInvokePatternAvailable: true
IsLegacyIAccessiblePatternAvailable: true
IsMultipleViewPatternAvailable: false
IsRangeValuePatternAvailable: false
IsScrollPatternAvailable: false
IsScrollItemPatternAvailable: false
IsSelectionItemPatternAvailable: true
IsSelectionPatternAvailable: false
IsTablePatternAvailable: false
IsTableItemPatternAvailable: false
IsTextPatternAvailable: false
IsTogglePatternAvailable: false
IsTransformPatternAvailable: false
IsValuePatternAvailable: false
IsWindowPatternAvailable: false
IsItemContainerPatternAvailable: false
IsVirtualizedItemPatternAvailable: false
IsSynchronizedInputPatternAvailable: false
FirstChild: [null]
LastChild: [null]
Next: "3700 Plus" radio button
Previous: "7100 Plus" radio button
Other Props: Object has no additional properties
Children: Container has no children
Ancestors: "Model" pane
"Wirebonder Software Upgrade" window
"Desktop" pane
[ No Parent ]

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

Re: Issue recognizing object in VB script app

Post by Support Team » Wed Oct 24, 2012 9:39 am

Hello,

It looks like that Inspect is not able to identify the buttons correctly as well.

In order to find those buttons you could add the parent element to the 'GDI Capture List'
by right-click on 'Element 'TVDSRadio' and click on 'Add Class Name to GDI Capture List'.

For more information take a look at:
Automation of Legacy Applications with the GDI Capture Plug-In

Regards,
Markus (T)
Ranorex Support Team

SeanP
Posts: 60
Joined: Wed Sep 01, 2010 11:48 pm
Location: Irvine California

Re: Issue recognizing object in VB script app

Post by SeanP » Thu Oct 25, 2012 5:37 pm

I dont have the option to add to GDI capture list.. see the attached jpeg's.

According to your instructions online, GDI plugin is already installed in 3.3.3
You do not have the required permissions to view the files attached to this post.

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

Re: Issue recognizing object in VB script app

Post by Support Team » Fri Oct 26, 2012 12:18 pm

Hi,

You have to do this in the Spy tool and not in your repository as explained in the mentioned blog.

Regards,
Markus
Ranorex Support Team

SeanP
Posts: 60
Joined: Wed Sep 01, 2010 11:48 pm
Location: Irvine California

Re: Issue recognizing object in VB script app

Post by SeanP » Tue Oct 30, 2012 9:32 pm

Markus,

So I was able to add the elements to the repository as stated and Ranorex can now find the elements relatively fast compared to what it did before. I am trying to put some robustness into this script. So if Model types are removed, I do not want to have to rebuild and redeploy.

Here is my XPath
element[@class='TVDSGroupBtn' and @instance='0']/radiobutton[@accessiblename='3600']

Each radio button has its own instance and I would like to not have them bound to an index ( 0 in this case).

If i remove the @instance = '0' , the element is no longer found. Is there another way I can do this?

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

Re: Issue recognizing object in VB script app

Post by Support Team » Wed Oct 31, 2012 2:50 pm

Hi,

You could use the "accessiblename" as follows:
/element[@accessiblename='7200']
or you could use a relative RxPath:
/form[@title~'^Wirebonder\ Software\ Upgra']/element[@class='TVDSRadio' and @instance='1']//radiobutton[@accessiblename='PowerFusion HL2']

Regards,
Markus