Set Value of dropdown box in browser

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
Snickers
Macro Veteran
Posts: 150
Joined: Thu Dec 09, 2004 3:01 pm
Location: Somewhere in TX

Set Value of dropdown box in browser

Post by Snickers » Tue Feb 09, 2016 4:37 pm

I am using MS12 but have tested using MS14 on internet Explorer v 11.0.9600
Findobject wizard does not set the value of the drop down box

On the webpage, there are three drop down boxes. I need to get the available values from the box and then set the value to one of those values

Is this possible using MS12 or MS14? It doesn't seem to work using findobject wizard in MS14
Is this possible using VB?
if so, what would be the code for getting possible values and then setting one of the values?

Thank you greatly for any assistance!

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Set Value of dropdown box in browser

Post by Marcus Tettmar » Thu Feb 11, 2016 1:14 pm

Hi,

To do this you need to use the IE set of commands which control IE and let you access the HTML elements. You can then set the value of a drop down and/or extract the HTML behind it to e.g. get an array of option values.

Have a look at:
http://help.mjtnet.com/article/154-usin ... ent-wizard
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Snickers
Macro Veteran
Posts: 150
Joined: Thu Dec 09, 2004 3:01 pm
Location: Somewhere in TX

Re: Set Value of dropdown box in browser

Post by Snickers » Mon Mar 07, 2016 7:02 pm

this feature works for setting text box values, but it doesn't want to set the value of a drop down box selector.
For example, it will successfully fill in the address, address2, and city, but it will not set the value for the State, which is selected in a drop down box. I haven't been able to get it to set the value for any drop down boxes.

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Set Value of dropdown box in browser

Post by Marcus Tettmar » Mon Mar 14, 2016 3:39 pm

Are you able to share the URL so that we can test? There may be something unusual about it, or some trick needed. If you can't share it here feel free to email support.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Snickers
Macro Veteran
Posts: 150
Joined: Thu Dec 09, 2004 3:01 pm
Location: Somewhere in TX

Re: Set Value of dropdown box in browser

Post by Snickers » Fri Feb 10, 2017 11:47 am


zabros2020
Pro Scripter
Posts: 70
Joined: Sun May 03, 2009 11:49 pm
Location: AU

Re: Set Value of dropdown box in browser

Post by zabros2020 » Wed Feb 15, 2017 2:25 am

Hey Snickers,

Populating the state works for me MSv14...
Try this:

Code: Select all

Let>url=https://www.printrunner.com/portal/my/address-book/
IEGetFromURL>%url%,ieRef
IEFormFill>%ieRef%,{""},{""},{"state_or_province"},#INDEX#:10,0,ie_res

'Or

Let>state=FL
Let>url=https://www.printrunner.com/portal/my/address-book/
IEGetFromURL>%url%,ieRef
IEFormFill>%ieRef%,{""},{""},{"state_or_province"},%state%,0,ie_res
Loving MS's Capabilities!!!

zabros2020
Pro Scripter
Posts: 70
Joined: Sun May 03, 2009 11:49 pm
Location: AU

Re: Set Value of dropdown box in browser

Post by zabros2020 » Wed Feb 15, 2017 2:40 am

Also....

Code: Select all

Let>url=https://www.printrunner.com/secure/shipping
IEGetFromURL>%url%,ieRef
IEFormFill>%ieRef%,{""},{""},{"state_or_province"},#INDEX#:11,0,ie_res
Loving MS's Capabilities!!!

Snickers
Macro Veteran
Posts: 150
Joined: Thu Dec 09, 2004 3:01 pm
Location: Somewhere in TX

Re: Set Value of dropdown box in browser

Post by Snickers » Sun Mar 05, 2017 2:52 pm

Are you able to set the value of a dropdown box such as changing the Quantity dropdown box?

https://www.printrunner.com/standard-bu ... cards.html

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts