Jump to content
Macro Express Forums

ME and IE webform drop downs


mgbennett
 Share

Recommended Posts

Hello,

 

I am new to macro express but not scripting. I have looked through the ME forum for a couple of hours and I don't seem to find anything on how to pick a value from a drop down in IE. I have a webform that I need to automate using a text file and there are several drop down options on the page, how do I go about having ME pick the right choice from the drop down?

 

If this is covered in some tutorial or some other place I am willing to read about it, I just don't know where to look or if it has been asked before. I think this is probably a common thing and I thought that I would find something rather quickly, but to no avail. If anybody can provide assistance or knows of a tutorial for webforms that would be great.

 

Here is kind of an example:

 

Let say I have a webform and on it there is a dropdown for vendors (there are over 50 or so items); I have a text file that I am reading and I don't have a problem populating in the text feilds, but I don't know how to do the dropdowns. So ME needs to find the vendors drop down and pick the vendor from the list that matches the text file.

 

Any direction is greatly appreciated. Thanks very much. :D

 

-Mike Bennett

Link to comment
Share on other sites

Hello,

 

I am new to macro express but not scripting. I have looked through the ME forum for a couple of hours and I don't seem to find anything on how to pick a value from a drop down in IE. I have a webform that I need to automate using a text file and there are several drop down options on the page, how do I go about having ME pick the right choice from the drop down?

 

If this is covered in some tutorial or some other place I am willing to read about it, I just don't know where to look or if it has been asked before. I think this is probably a common thing and I thought that I would find something rather quickly, but to no avail. If anybody can provide assistance or knows of a tutorial for webforms that would be great.

 

Here is kind of an example:

 

Let say I have a webform and on it there is a dropdown for vendors (there are over 50 or so items); I have a text file that I am reading and I don't have a problem populating in the text feilds, but I don't know how to do the dropdowns. So ME needs to find the vendors drop down and pick the vendor from the list that matches the text file.

 

Any direction is greatly appreciated. Thanks very much. :D

 

-Mike Bennett

 

Mike,

 

You'll stand a better chance of a practical solution if you give us a specific example, i.e. the URL and the drop-down you're targeting, as methods can vary a lot.

 

But to get you started, here's one general approach. On the Advanced Google Search page at

http://www.google.co.uk/advanced_search

there's a drop-down box for Results per page. Part of your macro might look like this

Keystroke Speed: 10 Milliseconds

// Open web page

Web Site: http://www.google.co.uk/advanced_search [internet Explorer - Wait to load]

// You probably already have your text from the file in T1. In my simplified example, it's in the clipboard

Variable Set String %T1% from Clipboard

// Click the drop-down for Results per Page

Mouse Move Window 729, 496

Mouse Left Button Click

// This is a crude selection routine and would need streamlining for larger numbers of entries

// If value = 10 then just key Enter

If Variable %T1% = "10"

Text Type: <ENTER>

End If

// If value = 20 then arrow down once

If Variable %T1% = "20"

Text Type: <ARROW DOWN>

Text Type: <ENTER>

End If

// If value = 30 then arrow down twice

If Variable %T1% = "30"

Text Type: <ARROW DOWN><ARROW DOWN>

Text Type: <ENTER>

End If

// If value = 50 then arrow down 3 times

If Variable %T1% = "50"

Text Type: <ARROW DOWN><ARROW DOWN><ARROW DOWN>

Text Type: <ENTER>

End If

// If value = 100 then arrow down 4 times

If Variable %T1% = "100"

Text Type: <ARROW DOWN><ARROW DOWN><ARROW DOWN><ARROW DOWN>

Text Type: <ENTER>

End If

Text Box Display: Conclusion

Macro Return

 

Here's the code if you want to try it )paste into Direct Editor):

 

<SPKEY:0010><REM2:Open web page><HTTP2:2:T:http://www.google.co.uk/advanced_search><REM2:You probably already have your text from the file in T1. In my simplified example, it's in the clipboard><TVAR2:01:03:><REM2:Click the drop-down for Results per Page><MMW2:729,496><LCLK><REM2:This is a crude selection routine and would need streamlining for larger numbers of entries><REM2:If value = 10 then just key Enter><IFVAR2:1:01:1:10><TEXTTYPE:<ENTER>><ENDIF><REM2:If value = 20 then arrow down once><IFVAR2:1:01:1:20><TEXTTYPE:<ARROW DOWN>><TEXTTYPE:<ENTER>><ENDIF><REM2:If value = 30 then arrow down twice><IFVAR2:1:01:1:30><TEXTTYPE:<ARROW DOWN><ARROW DOWN>><TEXTTYPE:<ENTER>><ENDIF><REM2:If value = 50 then arrow down 3 times><IFVAR2:1:01:1:50><TEXTTYPE:<ARROW DOWN><ARROW DOWN><ARROW DOWN>><TEXTTYPE:<ENTER>><ENDIF><REM2:If value = 100 then arrow down 4 times><IFVAR2:1:01:1:100><TEXTTYPE:<ARROW DOWN><ARROW DOWN><ARROW DOWN><ARROW DOWN>><TEXTTYPE:<ENTER>><ENDIF><TBOX4:T:1:001387000525000278000200:000:ConclusionYou chose the value %T1%,

That should now be in the drop-down box ready for continuing to another drop-dwn box or closing the web form.><MRETURN>

 

--

Terry, East Grinstead, UK

Link to comment
Share on other sites

Though you may know this already: A lot of drop-down-type menus will let you type in them and they will skip forward to the menu item

you're searching for. So with Macro Express, you just have the macro use the mouse (or Tabs/Controls etc.) to select the menu list, then

have the macro type the text of the menu item you're searching for.

 

If that method won't work for the menus you're trying to manipulate, but the menu is static, so you always know how far down a particular

item is going to be, you can pre-code your macro to arrow down as many times as necessary for each individual item on the list (which

could result in a painfully long bit of macro coding).

 

A quick glance through the suggestion Terry made above leads me to believe that is a better option than the arduous suggestion I just

made.

Link to comment
Share on other sites

terrypin,

 

Thanks for the quick response. I had to adjust the mouse position based on my screen but I was able to work through your options on google. This is what I was looking for. I will figure out how to loop through the options until it is found as I think I already have an idea in my head on how to do this.

 

Thanks for your help. :)

Link to comment
Share on other sites

You can use 'get control' and all the window controls stuff to grab the text from a dropdown box in many applications.

 

Things like (when tabbed to dropdown)

 

get text from control

store text to var

down arrow

repeat

 

Have worked well for me for mining data. Not sure if this is your aim but it seems that you would need this for anything interpretive (where you didn't already know what you would see ahead of time)... but as always with macros: whatever works!

 

Though seriously ME 3 needs a 'select from dropdown menu' and other dropdown functions like nothing else... this has limited me in so many ways so many times.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...