find item from "dropdown combobox" from webbpage

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
fimo420
Posts: 55
Joined: Wed Jun 20, 2012 9:49 am

find item from "dropdown combobox" from webbpage

Post by fimo420 » Wed May 15, 2013 1:03 pm

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

User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: find item from "dropdown combobox" from webbpage

Post by Ciege » Wed May 15, 2013 4:28 pm

See if the method I posted here does what you want: http://www.ranorex.com/forum/list-item- ... t4036.html
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

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

Re: find item from "dropdown combobox" from webbpage

Post by Support Team » Wed May 15, 2013 4:39 pm

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
.
Image

fimo420
Posts: 55
Joined: Wed Jun 20, 2012 9:49 am

Re: find item from "dropdown combobox" from webbpage

Post by fimo420 » Thu May 16, 2013 8:43 am

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 :)