HTML_GetFormByURL Function

Description:

The HTML_GetFormByURL function returns an HTML form.

Format:

HTTP GET HOST Hostname URL url formVar = HTML_GetFormByURL(options, formURL);
HTTP GET HOST Hostname URL url formVar = HTML_GetFormByURL(options, formURL, formIndex);
HTTP GET HOST Hostname URL url formVar = HTML_GetFormByURL(options, formURL, formIndex, submitIndex);
formVar = HTML_GetFormByURL(inputHtml, formURL);
formVar = HTML_GetFormByURL(inputHtml, formURL, formIndex);
formVar = HTML_GetFormByURL(inputHtml, formURL, formIndex, submitIndex);

Parameters:

formVar

A form variable into which the form will be loaded.

options

Available options are:

CONTENT  The function is applied on the current HTTP response 

formURL

A string expression containing the form URL ('action' attribute).

formIndex

An integer expression containing the form index in the HTML.

submitIndex

An integer expression containing the index of the submit type input in the form.

inputHtml

A string expression containing HTML from which the function will extract a specified form.

Example:

FORM formVar;
STRING szHTML;

// Retrieve first form in HTML page
HTTP GET HOST "demo.fmstocks.com" URL "/fmstocks/home.asp" formVar = HTML_GetFormByURL(content, "default.asp");

HTTP GET HOST "demo.fmstocks.com" URL "/fmstocks/home.asp" szHTML = GetContent();
formVar = HTML_GetFormByURL(szHTML, "default.asp");

LOG "formVar = " + ToString(formVar);

Output:

formVar = login=ta553&password=ta&LoginButton=Login

See also:





Go back to the Learning center:


Copyright © AgileLoad. All rights reserved.
Agile Load testing tool| Contact AgileLoad | Terms of Use | Sitemap