LoadRunner interface Test Basic Operation method

Source: Internet
Author: User

1. Open Loadrunner11, select the webserver protocol, such as:

2. Click Insert-new Step, such as:

3. Select Custom Request, such as:

Note: Web_custom_request: Applies to get and post requests common,

Web_submit_data: can only be used for post requests,

Web_submit_form: can only be used for GET requests

4. Write the interface script as follows:

Action ()

{int httpretcode;

Web_submit_data ("Web_submit_data",

"Action=http://192.168.1.111:8081/api/getroominfo?",//interface address

"Method=post",

"Targetframe=",

"Reccontenttype=application/x-www-form-urlencoded",

"Referer=http://{url}/login_wj;jsessionid={jsessionid}",

ItemData,

"Name=shopinfo", "Value= College Road _3", Enditem,

"Name=requesttime", "value=2015-07-13", Enditem,//Insert parameter value

"Name=roomid", "value=4", Enditem,

last);

Httpretcode=web_get_int_property (Http_info_return_code);

if (httpretcode==200)

{lr_output_message ("Success! ");

}

Else

{Lr_output_message ("Failed! ");

}

return 0;

}

5. Select Vuser-run time Settings, such as:

6. Select log, such as:

7. Execute the script to view the log results:

8. If the "_1" value does not exist in the database, click Execute to view the results, such as:

LoadRunner interface Test Basic Operation method

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.