HTML_GetForm Function

Description:

The HTML_GetForm function returns an HTML form.

By default, only the form fields which are enabled are loaded. The varoptions parameter allows to specifiy if the disabled form fields must be loaded or not.
A form field is disabled the "disabled" attribute is specified :

<input name="login" disabled type="text" value="John">

Format:

HTTP GET HOST Hostname URL url formVar = HTML_GetForm(options, formIndex);
HTTP GET HOST Hostname URL url formVar = HTML_GetForm(options, formIndex, submitIndex);
HTTP GET HOST Hostname URL url formVar = HTML_GetForm(options, formIndex, all_vars|enabled_vars_only);
HTTP GET HOST Hostname URL url formVar = HTML_GetForm(options, formIndex, submitIndex, all_vars|enabled_vars_only);
formVar = HTML_GetForm(inputHtml, formIndex);
formVar = HTML_GetForm(inputHtml, formIndex, submitIndex);
formVar = HTML_GetForm(inputHtml, formIndex, all_vars|enabled_vars_only);
formVar = HTML_GetForm(inputHtml, formIndex, submitIndex, all_vars|enabled_vars_only);

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 

formIndex

A 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 the form.

options

Available options are:

all_vars enabled and disabled variables are loaded
enabled_vars_only

 disabled variables are ignored 

Example:

FORM formVar;
STRING szHTML;

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

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

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