Manually editing a macro file if automatic recording fails

Information related to the use of iMacros for form filling and data upload.

Moderator: iMacros Moderators

Manually editing a macro file if automatic recording fails

by Tech Support on Thu Oct 16, 2008 7:12 am

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 9535 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?bsc=t&targetPage=reservationOnHomepage.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?bsc=t&targetPage=reservationOnHomepage.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 :)
User avatar
Tech Support
 
Posts: 5003
Joined: Tue Sep 20, 2005 12:25 pm

Return to How-To's and Examples for Form Filling

Who is online

Users browsing this forum: No registered users and 2 guests

-->