Page 1 of 1

Combobox click issue

Posted: Tue Feb 18, 2014 2:43 pm
by hnporter
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!

Re: Combobox click issue

Posted: Tue Feb 18, 2014 3:04 pm
by krstcs
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.

Re: Combobox click issue

Posted: Tue Feb 18, 2014 3:23 pm
by hnporter
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?

Re: Combobox click issue

Posted: Tue Feb 18, 2014 4:09 pm
by krstcs
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.

Re: Combobox click issue

Posted: Tue Feb 18, 2014 4:35 pm
by hnporter
Attached is the snapshot - please let me know if there's anything else I can provide. The combobox in questions is 'cmbScreen'.

Re: Combobox click issue

Posted: Wed Feb 19, 2014 2:54 pm
by Support Team
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

Re: Combobox click issue

Posted: Wed Feb 19, 2014 4:26 pm
by hnporter
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.

Re: Combobox click issue

Posted: Wed Feb 19, 2014 4:50 pm
by krstcs
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.