HTML_GetFormValue Function

Description:

The HTML_GetFormValue function returns an HTML form value.

Format:

HTTP GET HOST Hostname URL url szVar = HTML_GetFormValue(options, formIndex, valueName);
HTTP GET HOST Hostname URL url szVar = HTML_GetFormValue(options, formIndex, valueName, valueNameIndex);
szVar = HTML_GetFormValue(inputHtml, formIndex, valueName);
szVar = HTML_GetFormValue(inputHtml, formIndex, valueName, valueNameIndex);
szVar = HTML_GetFormValue(FormExpr, valueName);
szVar = HTML_GetFormValue(FormExpr, valueName, valueNameIndex);

Parameters:

szVar

A string variable into which the value will be loaded.

options

Available options are:

CONTENT  The function is applied on the current HTTP response 

formIndex

An integer expression containing the form index in the HTML.

valueName

A string expression containing the form value name.

valueNameIndex

An integer expression containing the index of the value name in the form.

inputHtml

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

FormExpr

A Form expression from which the function will extract a specified form value.

Example:

STRING szVar;
STRING szHTML;
FORM FormVar;

// Retrieve the login element value from the first form in the HTML page
HTTP GET HOST "demo.fmstocks.com" URL "/fmstocks/" szVar = HTML_GetFormValue(content, 1, "login");

HTTP GET HOST "demo.fmstocks.com" URL "/fmstocks/" szHTML = GetContent();
szVar = HTML_GetFormValue(szHTML, 1, "login");

LOG "szVar = " + szVar;

// Retrieve the login element value from the FormVar variable
HTTP GET HOST "demo.fmstocks.com" URL "/fmstocks/" FormVar = HTML_GetForm(content, 1);
szVar = HTML_GetFormValue(FormVar, "login");

LOG "szVar = " + szVar;

Output:

szVar = ta553

See also:





Go back to the Learning center:


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