web_url
Loads the specified web page (GET request).
C Language
int web_url( const char *StepName, const char *url, <List of Attributes>, [EXTRARES, <List of Resource Attributes>,] LAST );
Java Language
int object.url( String stepName, String url, String[] argumentList );
Argument | Description |
---|---|
object | An expression evaluating to an object of type WebApi. Usually web for Java. See also Function and Constant Prefixes. |
StepName | The label of the step in the Graphical script. Also used as the transaction name for automatic transactions. |
URL | The URL (Uniform Resource Locator) of the web page to load. The format is "URL=< address>" . The URL may be any of the following protocols: HTTP, HTTPS, or FTP. For authentication purposes, include both the user name and the password in the URL attribute using the following format: ftp://username:password@server/dir/path. |
List of Attributes | See below in this section: List of Attributes |
EXTRARES | A demarcation parameter indicating that the next parameter will be a list of resource attributes. |
List of Resource Attributes | |
LAST | A marker that indicates the end of the argument list. |
Return Values
This function returns LR_PASS (0) on success, and LR_FAIL (1) on failure.
Parameterization
The following argument(s) can be parameterized using standard parameterization: List of Attributes
General Information
The web_url function is an action function that loads the web page (GET request) specified by the URL argument. (Each Web Action Function in a script causes the browser to display a new web page or frame. All Web Action functions can be recorded by VuGen.) The web_url function does not require a context.
web_url is recorded only when VuGen is in either URL–based recording mode, or in HTML–based recording mode with the A script containing explicit URLs only option checked (see VuGen's Recording Options).
You can use web_url to simulate the download of a file from an FTP server. The web_url function causes the server to perform the same tasks as if a file were actually being downloaded. The download is done in binary mode, unless "FtpAscii=1" is specified.
Examples of non–HTML–generated resources are .gif and .jpg images. The List of Resource Attributes is only inserted when the recording option for these resources is set at Record within the current script step. This is the default setting. See the Virtual User Generator Help Center (select the relevant version)
The HTTP header can be modified to pass additional information about the request to the server. Using HTTP headers you can, for example, allow other content types in the response such as compressed files, or you can request a web page only on certain conditions. To modify the HTTP header in the request, see web_add_header. To modify all subsequent requests, see web_add_auto_header.
This function is supported for all web scripts.
List of Attributes
FtpAscii | "1" to perform an FTP transfer in ASCII mode, "0" for binary mode. |
TargetFrame | The name of the frame containing the current link or resource. See TargetFrame for more information. |
RecContentType | The content–type of RESPONSE header during recording, for example, text/html, application/x–javascript. It is read to determine whether the target URL is a recordable resource. See RecContentType for more information. |
Referer | The URL of the referring web page. The page that referred to the current page. If the location was explicitly expressed, this attribute is omitted. |
Resource | A value indicating whether the URL is a resource: 0 – the URL is not a resource 1 – the URL is a resource |
ResourceByteLimit | See ResourceByteLimit for more information. |
Snapshot | The file name of the snapshot file (inf extension), used for correlation. |
Mode | The Recording Level: HTML or HTTP. "Mode=HTML" is not allowed on web_url requests in concurrent groups. In a concurrent group, the responses of the downloaded resources looking for additional objects to download are not parsed. Click Recording Level / Mode (Web) for more information. |
UserAgent | Identifies a component other than the browser that will execute the step, for example, an ActiveX component running under the browser. This user agent header is sent for the requests made by the step. No check is made to confirm that the user agent argument matches the browser's User-Agent Runtime Setting. Non-browser steps do not affect the emulated browser context, nor do they build a new context from the result. |
EXTRARES handling
When Mode=HTML, the response HTML returned from the server is parsed. The response is scanned for embedded links to resources such as JavaScript, images, or CSS content, and automatically retrieves those resources if they are not already cached by the Vuser. Many pages also retrieve content that is triggered by Javascript requests. During a recording, VuGen adds these resources to the EXTRARES section of the request. They are then requested as part of the page if not previously cached.
The EXTRARES section then includes one or more of these entries:
"Url=xxxxx", "Referer=xxxxx", ENDITEM,