select a specific combobox option on web form
Moderators: Dorian (MJT support), JRL
select a specific combobox option on web form
I have a web form that I enter information in all the time. The problem is on the combobox option I alway need to select the 2 option and sometimes depending on when the macro is executed the 1st option is selected but sometimes it has my previous selection. Is there anyway to figure out which one is selected and if it is the first one to select the 2nd option.
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
select a specific combobox option on web form
That didn't seem to work for me. Maybe I'm getting confused as to what a combo box is. I have 3 options that I can select that will put a dot beside my selected option. When I left click on the one I want and press HOME nothing happens and if I press DOWN twice it just moves to the 3rd option down.
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
Aha, you have described a Radio Button Group. That will be tougher.
You may have to experiment with this one.
Try going to the field just previous to the Radio Buttons.
Then PRESS TAB, that may bring you to the first option, or it may bring you the option that is set. If it goes to the first option, then just PRESS RIGHT ARROW to move to the second option, that may set the value, then just PRESS ENTER.
But this may not work, it will be a function of many things out of your control. You may need to press the spacebar to set the value, but if that button is already set, then you will be unsetting it.
So, you may need to do Image recognition. You may need an image for each button, then loop through to find which one is set. Then you can go to the previous button and do the keystrokes as needed based on the results of the image analysis.
You may have to experiment with this one.
Try going to the field just previous to the Radio Buttons.
Then PRESS TAB, that may bring you to the first option, or it may bring you the option that is set. If it goes to the first option, then just PRESS RIGHT ARROW to move to the second option, that may set the value, then just PRESS ENTER.
But this may not work, it will be a function of many things out of your control. You may need to press the spacebar to set the value, but if that button is already set, then you will be unsetting it.
So, you may need to do Image recognition. You may need an image for each button, then loop through to find which one is set. Then you can go to the previous button and do the keystrokes as needed based on the results of the image analysis.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!
-
- Junior Coder
- Posts: 22
- Joined: Mon Sep 12, 2005 1:34 am
- Location: Melbourne - Australia
What does one do if it's an actual dropdown list. Such as featured in http://www.whitepages.com.au/wp/index.jsp
Choose a state.
Is there a way to pick a specific option using webrecorder?
Thanks
Choose a state.
Is there a way to pick a specific option using webrecorder?
Thanks
Macro Scheduler since Version 5.0 - 21/10/1998
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
Looked at that link.
The field for State is a combo box. See my combo box instructions above.
1. Tab into the field for State.
2. Then Home/End to top/bottom, Up/Down*x to move to selection. Can also type the first letter to move to center, then press Up/Down*x.
Example, suppose combo has "Tasmania".
Tab into the State
Press Home
Press Down*2
This results in "New South Wales" as the selection.
Now Press Tab to leave the field.
The field for State is a combo box. See my combo box instructions above.
1. Tab into the field for State.
2. Then Home/End to top/bottom, Up/Down*x to move to selection. Can also type the first letter to move to center, then press Up/Down*x.
Example, suppose combo has "Tasmania".
Tab into the State
Press Home
Press Down*2
This results in "New South Wales" as the selection.
Now Press Tab to leave the field.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!
-
- Junior Coder
- Posts: 22
- Joined: Mon Sep 12, 2005 1:34 am
- Location: Melbourne - Australia
Thanks Bob,
but the webpage mentioned was just a sample, as the real one I need to automate is locked down behind a firewall.
The actual webpage has a looong (200+) list of userids in a combo box all starting with D, then some numbers. (don't get me started on bad web design ) The combo box only allows "type ahead" on the first character.
I'm sure I read some entries somewhere in the discussion forums on how to automate combo boxes, but I can't find the threads.
but the webpage mentioned was just a sample, as the real one I need to automate is locked down behind a firewall.
The actual webpage has a looong (200+) list of userids in a combo box all starting with D, then some numbers. (don't get me started on bad web design ) The combo box only allows "type ahead" on the first character.
I'm sure I read some entries somewhere in the discussion forums on how to automate combo boxes, but I can't find the threads.
Macro Scheduler since Version 5.0 - 21/10/1998
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
If you need the second one Iyour original posting), you usually just need to set the focus in the field, press HOME, and press DownArrow 2 times.
How do you do this manually?
Whatever you do manually you can do with the keys in the script.
Experiment with making the selection manually .... how to get to the Home position, or to the end, or to the first letter. Then count the Up//Down arrows to move to the desired selection. Then use all of those keys in the script.
How do you do this manually?
Whatever you do manually you can do with the keys in the script.
Experiment with making the selection manually .... how to get to the Home position, or to the end, or to the first letter. Then count the Up//Down arrows to move to the desired selection. Then use all of those keys in the script.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
If you are using WebRecorder you can use the ItemSelected functin to return the index and/or string of the selected item in a SELECT field (drop down).
You can also use FormFill function to set the value of a drop down (SELECT) field either by value or by index.
You can also use FormFill function to set the value of a drop down (SELECT) field either by value or by index.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?