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
Webrecorder
Moderators: Dorian (MJT support), JRL
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
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?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
-
- Pro Scripter
- Posts: 50
- Joined: Fri Mar 23, 2007 10:14 am
I have this at the beginning of the script: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.
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
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
{"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
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?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
-
- Pro Scripter
- Posts: 50
- Joined: Fri Mar 23, 2007 10:14 am