Webrecorder

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
snapper1969
Pro Scripter
Posts: 50
Joined: Fri Mar 23, 2007 10:14 am

Webrecorder

Post by snapper1969 » Thu Feb 10, 2011 11:52 am

Hi,

I'm trying to insert a username as a variable into a webrecorder script but I can't get it to work, is this possible. The script works already but I would like the option of changing login details via an ini file?.

Thx,

John

adroege
Automation Wizard
Posts: 438
Joined: Tue Dec 07, 2004 7:39 pm

Post by adroege » Thu Feb 10, 2011 1:18 pm

Should be possible.

Please post your code for review.

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Thu Feb 10, 2011 1:23 pm

Yes it is possible. Use the ReadIniFile command to read the variable from the INI file. Replace the literal used in your WebRecorder code with the name of the variable.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

snapper1969
Pro Scripter
Posts: 50
Joined: Fri Mar 23, 2007 10:14 am

Post by snapper1969 » Thu Feb 10, 2011 1:29 pm

mtettmar wrote:Yes it is possible. Use the ReadIniFile command to read the variable from the INI file. Replace the literal used in your WebRecorder code with the name of the variable.
I have this at the beginning of the script:
ReadIniFile>z:\websites login.ini,url,parm1,StrName
Let>username=StrName

THis is what I have in the webrecorder part:
Let>FrameName={""}
Let>FormName={"aspnetForm"}
Let>FieldName={"ctl00$deContent$AppLogin_3b5$txtEmail"}
Let>FieldValue={"username"}
IE_FormFill>%IE[0]%,str:FrameName,str:FormName,str:FieldName,str:FieldValue,0,r

It is just inserting 'username' on the web page.

Thx,

John

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Thu Feb 10, 2011 1:31 pm

{"username"} is a literal string.

Change your first bit to:

ReadIniFile>z:\websites login.ini,url,parm1,StrName

And the WR part to:

Let>FrameName={""}
Let>FormName={"aspnetForm"}
Let>FieldName={"ctl00$deContent$AppLogin_3b5$txtEmail"}
Let>FieldValue=StrName
IE_FormFill>%IE[0]%,str:FrameName,str:FormName,str:FieldName,str:FieldValue,0,r

Or just:

Let>FrameName={""}
Let>FormName={"aspnetForm"}
Let>FieldName={"ctl00$deContent$AppLogin_3b5$txtEmail"}
IE_FormFill>%IE[0]%,str:FrameName,str:FormName,str:FieldName,str:StrName,0,r
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

snapper1969
Pro Scripter
Posts: 50
Joined: Fri Mar 23, 2007 10:14 am

Post by snapper1969 » Thu Feb 10, 2011 1:52 pm

Thx Marcus - that works great!!

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts