[Solved]Question on a drop down box

Ask general questions here.
c170
Posts: 4
Joined: Tue Jan 22, 2013 7:33 pm

[Solved]Question on a drop down box

Post by c170 » Mon Feb 04, 2013 10:58 pm

Ciege's solution worked perfect. Using the WebDocument.ExecuteScript() method allowed me to manually fire the events associated with the drop down buttons.

Hey everyone, having an issue with a drop down box on a router's configuration webpage.

For example, if I set a select tag to the path of the drop down box, and then set an option tag to true, it will change the value of the drop down box, but the other content on the webpage wont reflect this - therefore, I need to replicate this in a manual effort. I tried following the combobox example on the website, in attempt to manually click on the data, but the element doesn't support a combobox type.

Does anyone have any suggestions for how to handle this?

Thank you.

Edit:
Additionally, I have assigned a SelectTag to the Drop Down Box, and attempted to create a list box item based off the select tag's children index, but having an error that it doesn't support the required capability when I attempt to cast it.

When I attempt to create an OptionTag of the SelectTag's child that I want, and try to perform a click, the mouse moves to the top left of the screen and clicks, but doing something such as optiontag.selected = true, will select the correct item from the drop down box(which unfortunately doesn't change the the webpage's content.)
Last edited by c170 on Thu Feb 07, 2013 7:18 pm, edited 1 time in total.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Question on a drop down box

Post by Support Team » Tue Feb 05, 2013 3:31 pm

Hello,

I am afraid that I didn't quite catch that. You try to select an item in within a combobox, but it is not possible to do this, right?
Could you please send us a Ranorex Snapshot file from the element?
Additionally it could be helpful to get a little example solution to analyze the issue.
Thank you!

Regards,
Bernhard

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

Re: Question on a drop down box

Post by Ciege » Tue Feb 05, 2013 3:58 pm

The first part of the question sounds like you are just setting the drop down to a value through code, instead of automating the click of the item you want selected in the drop down. In this case, just setting the value in code is probably not triggering the fire event that tells the AUT to update the other parts of the page. You need to either automate the opening and selecting of the item (just as a user would do) so that the fire event triggers properly, or you need to determine how to fire the even yourself (through code) when you set the value of the drop drop down through code.
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...

c170
Posts: 4
Joined: Tue Jan 22, 2013 7:33 pm

Re: Question on a drop down box

Post by c170 » Tue Feb 05, 2013 4:27 pm

Thank you guys for the quick responses. I have e-mailed a snapshot.

Yes, I'm trying to handle the dropdown control through code, opposed to click automation, as there tends to be a lot of different values that are possible to select, and with nearly 200 routers to do, click automation would become tiring.

You're correct, setting the value doesn't seem to trigger any of the other events.

I have tried many approaches to attempt to change the values in a drop down box, but none seem to trigger the additional firing events manually clicking does.

For example:
SelectTag st = path;
OptionTag ot = st.FindSingle(.//option[@value='g and b']);
ot.Selected = true;

This will change the dropdown box to g and b, but it wont fire the additional events.


Thank you for your help.

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

Re: Question on a drop down box

Post by Ciege » Tue Feb 05, 2013 5:13 pm

As I said before, setting the option through code WILL NOT trigger the even. You need to fire the event yourself if you want to do it this way (as opposed to selecting the even through automation).

See if this thread may help you: http://www.ranorex.com/forum/unable-to- ... t3413.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...

c170
Posts: 4
Joined: Tue Jan 22, 2013 7:33 pm

Re: Question on a drop down box

Post by c170 » Tue Feb 05, 2013 5:17 pm

Ciege wrote:As I said before, setting the option through code WILL NOT trigger the even. You need to fire the event yourself if you want to do it this way (as opposed to selecting the even through automation).

See if this thread may help you: http://www.ranorex.com/forum/unable-to- ... t3413.html
Thank you very much. I'll take a look through that.