Loadrunder Script Chapter--web_custom_request function Introduction

Source: Internet
Author: User
Tags list of attributes

C language version:

int web_custom_request (const char *requestname,

[Extrares,,] last);

Parameter description:

Requestname step name, which is the request name.

List of Attributes property lists

Note: Property names are case sensitive

Extrares defining parameters, table names the next parameter will be a list of resource properties

Last table Name list end of tag

List of Attributes

URL-Uniform Resource Locator, typically a request link address

Method-Request methods: POST, GET

TargetFrame-the name of the frame that contains the current link or resource

EncType-the type of encoding used by the submission request (type of encoding). ENCTYPE Specifies the value of the "Content-type" request header, such as "text/html". Web_custom_request does not process the non-encoded request body. The body parameter specifies the request experience using the specified encoding. Therefore, a server-side error may be raised if the specified enctype does not match the request body. Typically, the enctype is not edited according to the recorded results.

If "EncType" is specified, it overrides the Content-type specified by the Web_add_[auto_]header function. If "enctype=" (null value), the "Content-type" request header is not generated, and if "EncType" is omitted, the Web_add_[auto_]header function is used. If neither enctype nor the Web_add_[auto_]header function is used to set the request header, and "Method=post", then "application/x-www-form-urlencoded" will be used as the default value. In other cases, the Content-type request header is not generated.

Reccontenttype-Specifies the type of Content–type response header, such as Text/html,application/x-javascript. When the resource property is not set, it is used to determine whether the destination URL is a recordable resource.

Refer-Specify the referenced page

Body-Request Body

Raw body-The request body is passed as a pointer to the data

Bodyfilepath-A file path that needs to be passed as a request body, cannot be used with the body, or any of the properties of the body, Raw body attribute: bodybinary, bodyunicode, Raw_body_start or Binary=1

Resource-A value indicating whether the URL is a resource

Resouce=1, which indicates that the URL is a resource, means that the current operation has little to do with the success of the script in which it resides. If an error occurs while downloading a resource, it is treated as a warning instead of an error

Whether the download URL is affected by the "Run-time Setting-browser emulation--download non-html resources" option. Tick this option to not parse the response information as HTML.

"Resource=0", which indicates that this URL is important, is not affected by the Send request (RTS) and resolves it when needed.

Resourcebytelimit-Download the Limit size of Web page resources. When the set limit is reached, resources are no longer downloaded and only work on the resources that need to be downloaded.

Snapshot-The file name (. inf suffix for the snapshot)

Mode-Recording level: HTML, HTTP

HTML level: Intuitive recording of HTML operations on the current web interface. These actions are recorded as Web_url, Web_link, Web_image, Web_submit_form, and so on step. Vugen only records requests that return an HTML page, and does not process scripts and applications.

HTTP level: Vugen all requests are recorded as Web_url step and do not generate Web_link, web_image, web_submit_form functions. This method is more flexible, but the resulting script is not intuitive.

ContentEncoding-the request is encoded using the specified method (gzip or deflate), and the corresponding "content-encoding:" HTTP header is sent along with this request. Available for web_custom_request and Web_submit_data only.

List of Resource Attributes

The list of attributes is generated by a non-HTML Web page that contains resources Javascript,activex,java applets and flash requests. Vugen recording options can be set to record these elements in the current script step or separate step (view recording in html–based Mode)

When recorded in step in the current script, additional resources are listed as parameters and support the following resource properties:

Web resources that the URL needs to load

Referer URL-referenced web page

Enditem represents the tag at the end of each resource in the list

While recording each resource as a single step, recording the non-html element in this mode can streamline the script and increase readability.

When an additional resource is encountered, for example, a Javascript,vugen recorder adds a resource to the list of additional resources (Resource attributes parameter list). When the script is played back, the resource is requested. If the resource is regularly changing, you can parameterize the resource with an association function.

Example:

Web_reg_save_param ("extrares_11",

"Lb=loadrunner <wbr> Script Development-web_custom_requests function Details"

"Rb=\" ",

"Ord=11",

last);

Web_url ("Web_url",

"Url=http://lazarus/html/links.html",

"Targetframe=",

"Resource=0",

"Referer=",

"Mode=http",

Extrares,

"Url={extrares_11}", Enditem,

last);

function Use range :

Supports all Web scripts and WAP scripts that run in HTTP protocol or Wireless session protocol (wsp,wireless session Protocol)

Loadrunder Script Chapter--web_custom_request function Introduction

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.