Page 1 of 1

Listitem.Select vs. ListItem.Click

Posted: Wed Sep 08, 2010 7:08 am
by artur_gadomski
Hi
I am automating a couple of MFC ComboBoxes. What I did was:
Ranorex.ComboBox c = _path;
c.Items[_index].Select();
_name = c.SelectedItemText;
And that works fine for all but one ComboBox. This particular ComboBox doesn't seem to be any different but it exhibits a particular behavior. When automating I choose a value from ComboBox, close a dialog and open it again to check if it's the same. This works when I use mouse(either through automation or manually), but fails when using select method.
I want to talk with developers and have them figure out why this particular control behaves differently but for that I would like to know what is the difference between using select method and actually expanding combo box and clicking on an item?

Re: Listitem.Select vs. ListItem.Click

Posted: Wed Sep 08, 2010 11:59 am
by Support Team
Hi,
artur_gadomski wrote:what is the difference between using select method and actually expanding combo box and clicking on an item?
The difference between Select() and Click() method of a list item is, that the Select() method only selects the item without any mouse movements (User interactions). The Click() method instead uses the mouse to click on the item as a "real" user would it do.

Would it also be possible to send us a Ranorex Snapshot of the corresponding combo box? Maybe we can find an issue why there is a difference.

How to create a Ranorex Snapshot
http://www.ranorex.com/support/user-gui ... html#c2072

Regards,
Peter
Ranorex Team

Re: Listitem.Select vs. ListItem.Click

Posted: Thu Sep 09, 2010 6:40 am
by artur_gadomski
I attach a snapshot of a not working and working combo box.
NotWorking.rxsnp
Working.rxsnp

Re: Listitem.Select vs. ListItem.Click

Posted: Thu Sep 09, 2010 11:49 am
by Support Team
I looked to your snapshots of the combo-boxes and I cannot find any difference. Maybe your developers implement the "not working" combo-box in a different way. This could be one possible cause why it is not working.

Regards,
Peter
Ranorex Team

Re: Listitem.Select vs. ListItem.Click

Posted: Thu Sep 09, 2010 4:33 pm
by Ciege
Is it possible that your dev team has implemented an onclick method on the "non working" combo box? Maybe on click (i.e. using the mouse) causes something to be set in the back end, that could be why the combo box is not as you expect it to be when you go back to it.

Using the select method in automation would not trigger the onclick to occur so anything that may be set by that onclick method would never happen.

Re: Listitem.Select vs. ListItem.Click

Posted: Tue Oct 05, 2010 6:48 am
by artur_gadomski
Developers said that there is no reason why one Combo Box should work and another not.
The same problem came up yesterday and I managed to find a workaround.
comboBox.Click();
comboBox.Items.Select();

This seems to work. First click opens up a comboBox then select selects a list item and closes comboBox.