Imacros: How to select from dropdown menu which is without the "content tag"

6.2k Views Asked by At

Normally when selecting an option from dropdown menu, the recorded macro look somewhat like this

TAG POS=1 TYPE=SELECT FORM=NAME:prod ATTR=NAME:variantID_4 CONTENT=%234

But a website gives me this code for dropdown menu

TAG POS=1 TYPE=LI FORM=ID:enterNewOfferForm ATTR=ID:conditionSelect_chzn_o_3

There is no CONTENT tag. As a result when I play the macro, it does not select anything from the dropdown menu.

Here is the full code

VERSION BUILD=10022823
TAB T=1
TAB CLOSEALLOTHERS
URL GOTO=website/enterNewOffer.php
TAG POS=1 TYPE=TEXTAREA:TEXT FORM=ID:enterNewOfferForm ATTR=NAME:artex2Input CONTENT=Description
TAG POS=4 TYPE=INPUT:TEXT FORM=ID:enterNewOfferForm ATTR=*
TAG POS=1 TYPE=LI FORM=ID:enterNewOfferForm ATTR=ID:conditionSelect_chzn_o_3 
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:enterNewOfferForm ATTR=NAME:taxInput CONTENT=2<SP>dollar
I tried many variations of the code but no success

1

There are 1 best solutions below

0
On

Please pay the attention that you need to get a value of select tag, not of some li item. It means that you need to use TYPE=SELECT (not TYPE=LI).

TAG POS=1 TYPE=SELECT FORM=ID:enterNewOfferForm ATTR=ID:conditionSelect_chzn_o_3

in the case if for some reason you really need to get a value of all options (li), you can extract them for future processing:

VERSION BUILD=1005 RECORDER=CR
SET !EXTRACT_TEST_POPUP NO

SET !EXTRACT NULL
TAG POS=1 TYPE=SELECT FORM=ID:enterNewOfferForm ATTR=ID:conditionSelect_chzn_o_3 EXTRACT=TXTALL
PROMPT {{!EXTRACT}}