Page 1 of 1

find item from "dropdown combobox" from webbpage

Posted: Wed May 15, 2013 1:03 pm
by fimo420
Hi,

I've just started using ranorex with webbpages and need some help.
I have a dropdown combobox on a page, and i want to select some of the items in that list.
Is there any example or tutorial anywhere that i can follow?
I found some code for that example but its way back in version 1 and 2 :(
And recording a script shows that it goes after positions which i dont wana do, i wana create a method that goes after identifiers.

Anyone out there that have solve this problem in a smooth way please let me know.

Would really appreciate the help!
Br,
Feroz

Re: find item from "dropdown combobox" from webbpage

Posted: Wed May 15, 2013 4:28 pm
by Ciege
See if the method I posted here does what you want: http://www.ranorex.com/forum/list-item- ... t4036.html

Re: find item from "dropdown combobox" from webbpage

Posted: Wed May 15, 2013 4:39 pm
by Support Team
fimo420 wrote:And recording a script shows that it goes after positions...
Are you sure? Ranorex always uses element identification and just uses relative positions within the elements to further specify click locations.
Do you get a technology limitation warning?

Regards,
Alex
Ranorex Team

Re: find item from "dropdown combobox" from webbpage

Posted: Thu May 16, 2013 8:43 am
by fimo420
Ciege wrote:See if the method I posted here does what you want: http://www.ranorex.com/forum/list-item- ... t4036.html
Hi Ciege,
Thanks man it works after some modifications.
I had to change listitem to Optiontag, cause when i used listitem it complained and didnt find the dropdown box items. With Optiontag, which it was when i checked in Ranorex Spy, your code worked fine :)
Thanks again, only issue i have is that it takes long time to click the dropdown item (around 3-4s) even when i removed all your delays. If you have any suggestions please let me know.
Support Team wrote:Are you sure? Ranorex always uses element identification and just uses relative positions within the elements to further specify click locations.
Do you get a technology limitation warning?
Regards,
Alex
Ranorex Team



Hi Alex,
Thakns for reply, well i've checked the code when recording and this is what i see:
It clicks on dropdownlist but after that it clicks on something called "Dropdown.Self", which is same for all items in the dropdown item.
I wanted to do like Ciege did, provide a dropdownitem name and then click on that.

Code: Select all

Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Up item 'SiriusGP.dropdownList' at 203;17.", repo.SiriusGP.dropdownListInfo, new RecordItemIndex(1));
            repo.SiriusGP.dropdownList.MoveTo("203;17");
            Mouse.ButtonUp(System.Windows.Forms.MouseButtons.Left);
            Delay.Milliseconds(1350);
            
            Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Click item 'Dropdown' at 65;10.", repo.Dropdown.SelfInfo, new RecordItemIndex(2));
            repo.Dropdown.Self.Click("65;10");
            Delay.Milliseconds(1190);
            
            Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Click item 'SiriusGP.dropdownList' at 152;15.", repo.SiriusGP.dropdownListInfo, new RecordItemIndex(3));
            repo.SiriusGP.dropdownList.Click("152;15");
            Delay.Milliseconds(1320);
            
            Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Click item 'Dropdown' at 65;18.", repo.Dropdown.SelfInfo, new RecordItemIndex(4));
            repo.Dropdown.Self.Click("65;18");
            Delay.Milliseconds(2210);

Thanks again both :)