HTML_GetFormValueByName Function

Description:

The HTML_GetFormValueByName function returns an HTML form value.

Format:

HTTP GET HOST Hostname URL url szVar = HTML_GetFormValueByName(options, formName, formNameIndex, valueName);
HTTP GET HOST Hostname URL url szVar = HTML_GetFormValueByName(options, formName, formNameIndex, valueName, valueNameIndex);
szVar = HTML_GetFormValueByName(inputHtml, formName, formNameIndex, valueName);
szVar = HTML_GetFormValueByName(inputHtml, formName, formNameIndex, 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 

formName

A string expression containing the form name in the HTML.

formNameIndex

An integer expression containing the form name 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.

Example:

STRING szVar;
STRING szHTML;

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

HTTP GET HOST "demo.fmstocks.com" URL "/fmstocks/home.asp" szHTML = GetContent();
szVar = HTML_GetFormValueByName(szHTML, "loginform", 1, "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