Manually editing a macro file if automatic recording fails

Information related to the use of iMacros for form filling and data upload.
Forum rules
iMacros EOL - Attention!

The renewal maintenance has officially ended for Progress iMacros effective November 20, 2023 and all versions of iMacros are now considered EOL (End-of-Life). The iMacros products will no longer be supported by Progress (aside from customer license issues), and these forums will also no longer be moderated from the Progress side.

Thank you again for your business and support.

Sincerely,
The Progress Team
Post Reply
User avatar
Tech Support
Posts: 4948
Joined: Tue Sep 20, 2005 7:25 pm
Contact:

Manually editing a macro file if automatic recording fails

Post by Tech Support » Thu Oct 16, 2008 2:12 pm

Some websites contain tricky AJAX elements that are not supported by the automatic recording.
imacros hertz.es.png
imacros hertz.es.png (84.76 KiB) Viewed 56357 times
So if you record a macro and replay fails, there are generally two options:

1. Re-record the problem element in DirectScreenmode
2. Edit the automatically generated macro file.

This post focuses on #2:

We try to reserve a car at hertz.es and record it. This is the automatically generated macro:

URL GOTO=http://www.hertz.es/rentacar/index.jsp? ... mepage.jsp
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:resForm ATTR=ID:pickupLocation CONTENT=ma
TAG POS=1 TYPE=DIV ATTR=TXT:MAD,Madrid<SP>Airport,Madrid,España
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:resForm ATTR=ID:day1Pos CONTENT=11
TAG POS=1 TYPE=TD ATTR=TXT:22
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:resForm ATTR=ID:day2Pos CONTENT=
TAG POS=4 TYPE=TD ATTR=TXT:29
TAG POS=1 TYPE=DIV ATTR=ID:reserveItButton

The red lines do not work during replay, because the AJAX/Javascript popups like the calendar control do not open. With DirectScreen clicks we can force them to open, but since our goal is "only" to reserve a car (= web automation, not testing the calendar control), we decide to fill in the fields directly.

How to edit the macro:
1. We remove the lines that cause the error (marked red above)
2. We add the required information directly to the macro (marked green below)

URL GOTO=http://www.hertz.es/rentacar/index.jsp? ... mepage.jsp
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:resForm ATTR=ID:pickupLocation CONTENT=MAD,Madrid<SP>Airport,Madrid,España
'TAG POS=1 TYPE=DIV ATTR=TXT:MAD,Madrid<SP>Airport,Madrid,España
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:resForm ATTR=ID:day1Pos CONTENT=22/10/2008
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:resForm ATTR=ID:day2Pos CONTENT=10/29/2008
TAG POS=1 TYPE=DIV ATTR=ID:reserveItButton

Voila! The second macro works :)
Post Reply