This article is mainly about how to correlate parameters, first set up Web tours
Such as
Click "Administration" J to go to the jump page as shown in
Tick the third item, drop down, and click on the "Update" button,
Close the browser,
Then use LR to record the script, the main action is to go to the homepage, enter the JoJo password input bean, click Login, and then click the "Sign off" button can be played back again, this time there will be an error
And this time Scan Association, the association below the table does not have any entries, this time we can go to script view to write script, the specific code is as follows
Web_reg_save_param ("Wcsparam_diff1",
"Lb=usersession value=",
"Rb=>",
"Ord=1",
"relframeid=1.2.1",
"Search=body",
last); (This function is an addition)
"Name=usersession", "value={wcsparam_diff1}", Enditem, (this line needs to be modified, value values are set to the parameters in that function above)
The entire code is posted below
Action () {Web_reg_save_param ("wcsparam_diff1", "lb=usersession value=", "rb=>", "ord=1", "relframeid=1.2.1", "Search=body", last); Web_url ("webtours", "url=http://localhost:1080/webtours/", "resource=0", "reccontenttype=text/html", "referer=", "Snapshot=t1.inf", "mode=html", last); Lr_think_time ( -); Web_submit_data ("login.pl", "action=http://localhost:1080/webtours/login.pl", "Method=post", "reccontenttype=text/html", "Referer=http://localhost:1080/webtours/nav.pl?in=home", "Snapshot=t2.inf", "mode=html", ItemData,"name=usersession","value={wcsparam_diff1}", Enditem,"Name=username","Value=jojo", Enditem,"Name=password","Value=bean", Enditem,"Name=jsformsubmit","Value=on", Enditem,"name=login.x","value=58", Enditem,"NAME=LOGIN.Y","value=8", Enditem, last); Web_image ("signoff Button", "Alt=signoff Button", "Snapshot=t3.inf", last);return 0;}
And then play it back again, and you're done!
Life Ah life, think of some past, think of some people, do not know whether you remember me this person, hey, hard work, and then try a little!
Examples of LR, how to correlate them, and implement them through code functions