HTML_GetFormByName Function

Description:

The HTML_GetFormByName function returns an HTML form.

Format:

HTTP GET HOST Hostname URL url formVar = HTML_GetFormByName(options, formName);
HTTP GET HOST Hostname URL url formVar = HTML_GetFormByName(options, formName, formIndex);
HTTP GET HOST Hostname URL url formVar = HTML_GetFormByName(options, formName, formIndex, submitIndex);
formVar = HTML_GetFormByName(inputHtml, formName);
formVar = HTML_GetFormByName(inputHtml, formName, formIndex);
formVar = HTML_GetFormByName(inputHtml, formName, 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 

formName

A string expression containing the form name.

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_GetFormByName(content, "loginform");

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

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