Combobox click issue

Ask general questions here.
hnporter
Posts: 18
Joined: Thu Jan 16, 2014 3:34 pm

Combobox click issue

Post by hnporter » Tue Feb 18, 2014 2:43 pm

My current test involves iterating through a number of items within a drop-down. Initially, I captured via Spy the 'arrow' button of the drop-down (located on the far-right of the drop-down). Ranorex identifies the XPath of this item as:

?/?/combobox[@automationid='cmbScreen']/button[@automationid='PART_DropDownButton']

My intent was to create a single method that would iterate through these items via Excel data source. However, after clicking on that button once (even without actually selecting anything in the list), the button can no longer be found by Ranorex. If I do a Record and click through a number of items in the drop-down, the first time through, it uses the above item, and every additional iteration it captures the combobox itself, with an XPath of:

?/?/combobox[@automationid='cmbScreen']/combobox[@automationid='PART_FocusSite']

The biggest issue that this causes is Ranorex uses coordinates to click on the place where previously the button was tracked. I can no longer just tell it to click in the 'center' or even 'upper right' or 'lower right'. As you can imagine, if the page moves location, or if another resolution is used, this step will fail. Is there some known issue with ComboBoxes in general? Any advice as to how to get around this issue? Thanks in advance!

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Combobox click issue

Post by krstcs » Tue Feb 18, 2014 3:04 pm

The "location" for a Click action is relative to the object you are clicking on. If you tell Ranorex to Click Center, it will click the Center of the object you pass to the method. The resolution, location on screen, etc., do not matter.

Your bigger problem seems to be that the object itself is not being recognized. I would guess that the issue is that you are identifying the object using some attribute of the object that changes when it is clicked, but without a snapshot there is no way for us to tell.

Can you just click on the combobox itself and not worry about the button? Most comboboxes do not require a click on the button, anywhere will do.
Shortcuts usually aren't...

hnporter
Posts: 18
Joined: Thu Jan 16, 2014 3:34 pm

Re: Combobox click issue

Post by hnporter » Tue Feb 18, 2014 3:23 pm

Thanks for your quick reply. My point is that telling Ranorex to click 'Center', 'Upper Right' or whatever no longer work on the 2nd iteration. Ranorex's version of 'Upper Right', for example, don't travel far enough to the right to click the spot. And this particular combobox (appears to be Infragistics) does not recognize a central click as being the same as a click on the arrow. The center click does not cause the drop-down to cascade open, unfortunately.

Is a snapshot of the entire app required, or can I just attach a snapshot of the combobox itself?

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Combobox click issue

Post by krstcs » Tue Feb 18, 2014 4:09 pm

You should take a snapshot of the element itself.

However, creating a snapshot will capture the structure of all parent elements of the captured element as well.
Shortcuts usually aren't...

hnporter
Posts: 18
Joined: Thu Jan 16, 2014 3:34 pm

Re: Combobox click issue

Post by hnporter » Tue Feb 18, 2014 4:35 pm

Attached is the snapshot - please let me know if there's anything else I can provide. The combobox in questions is 'cmbScreen'.
Attachments
combobox.rxsnp
(136.41 KiB) Downloaded 96 times

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

Re: Combobox click issue

Post by Support Team » Wed Feb 19, 2014 2:54 pm

Hi hnporter,

Thank you for providing the Ranorex snapshot.
As krstcs already mentioned, it seems like the element itself is not found within the second iteration. Please check if the “AutomationId”-property of the button or even from the ComboBox itself changes. If yes, try to modify the RxPath to be sure that they are recognized properly within each iteration. Since there is only one button in the ComboBox you could use e.g.:

Code: Select all

/?/?/combobox[@automationid='cmbScreen']/button 
In order to define the RxPath of the button.

Regards,
Robert
.
Image

hnporter
Posts: 18
Joined: Thu Jan 16, 2014 3:34 pm

Re: Combobox click issue

Post by hnporter » Wed Feb 19, 2014 4:26 pm

The RxPath of the button already includes a reference to the ComboBox:

/?/?/combobox[@automationid='cmbScreen']/button[@automationid='PART_DropDownButton']

However, I did notice something interesting just now. When I first load the page and track the button, it resolves easily:

Image

If I click on the button, then try to track again, it cannot track the item:

Image

Note that the text in the drop-down is selected now. If I tab off of the drop-down and try tracking again, it can now find the button:

Image

So somehow when text is selected in the drop-down, the button becomes untrackable until it's tabbed off. Has this been seen before? Is it typical of other drop-downs and not just Infragistics? Or is this an issue with Ranorex and its tracking? Thanks in advance for any assistance.

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Combobox click issue

Post by krstcs » Wed Feb 19, 2014 4:50 pm

I would guess that this is an issue with the application under test doing something funny with the form structure when an item is selected. It may be a bug.

I would get with your developers and show them the issue, they may be able to figure out what the problem is on their end and fix it.
Shortcuts usually aren't...