selection of a drop down option, fill/replace/replace

Support for iMacros. The iMacros software is the unique solution for automating every activity inside a web browser, for data extraction and web testing.
Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
tata668
Posts: 42
Joined: Sun Jun 14, 2009 2:34 am

selection of a drop down option, fill/replace/replace

Post by tata668 » Tue Jun 16, 2009 6:49 pm

I try to select the select option that is the closest possible to the text I target. But I don't always know what the available options will be.

Let's say the text I target is "home insurance" in a "category" drop down input. It's possible that the closest option on a particular site will be "insurance", not "home insurance".

This is my iMacro:

===============
TAB T=1

SET !TIMEOUT 1
SET !ERRORIGNORE YES
SET !REPLAYSPEED FAST

'TAG POS=1 TYPE=SELECT FORM=ACTION:* ATTR=NAME:*category* CONTENT=$*real estate*
TAG POS=1 TYPE=SELECT FORM=ACTION:* ATTR=NAME:*category* CONTENT=$*home*
'TAG POS=1 TYPE=SELECT FORM=ACTION:* ATTR=NAME:*category* CONTENT=$*insurance*
'TAG POS=1 TYPE=SELECT FORM=ACTION:* ATTR=NAME:*category* CONTENT=$*home<SP>insurance*

==============

What I'd like it to do, is to select the "real estate" option if it is found, replace it with "home" if "home" is found, replace it with "insurance" if "insurance" is found and finally replace it with the best option, "home insurance" if it is found. But currently, what iMacros does is that if "insurance" is found, but "home insurance" is NOT found, it empties the drop down, it doesn't leave "insurance" as the selected option.

This is not useful for me because I can't manage my form filling as I'd like: fill/replace/replace.

Do you have something to suggest?

Thanks in advance!
Marcia, Tech Support

Re: selection of a drop down option, fill/replace/replace

Post by Marcia, Tech Support » Fri Jun 19, 2009 9:00 am

Hello,

I believe you will need some kind of scripting to deal with all this conditions... Please, see http://wiki.imacros.net/FAQ#Q:_Are_ther ... statements... and http://wiki.imacros.net/Web_Scripting. If you are running the free iMacros Add-on for Firefox, it is also worth a look at http://wiki.imacros.net/iMacros_for_Fir ... _Interface.
tata668
Posts: 42
Joined: Sun Jun 14, 2009 2:34 am

Re: selection of a drop down option, fill/replace/replace

Post by tata668 » Fri Jun 19, 2009 12:44 pm

I'll look into this!

May I suggest that, even without scripting, a way to prevent iMacros from modifying the selectedIndex of a select input when the text to find is not found, would be a really good idea!

Thanks for the help.
Post Reply