HTML_GetFormValueList Function

Description:

The HTML_GetFormValueList function returns a one dimension string array containing an HTML form value list.

Format:

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

Parameters:

arrayVar

A one dimension array string variable into which the values 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 list.

FormExpr

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

Example:

STRING arrayVar[];
STRING szHTML;
INTEGER iNbValues;
INTEGER i;

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

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

iNbValues = Bound(arrayVar, 1);
for i = 1 to iNbValues
    LOG "value " + ToString(i) + " = " + arrayVar[i];
endfor

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

iNbValues = Bound(arrayVar, 1);
for i = 1 to iNbValues
    LOG "value " + ToString(i) + " = " + arrayVar[i];
endfor

Output:

value 1 = ta553

See also:





Go back to the Learning center:


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