Examples of LR, how to correlate them, and implement them through code functions

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.