HTML_SetFormValue Function

Description:

This function assigns a value in a Form field.

Format:

HTML_SetFormValue(formVar, fieldName, value);
HTML_SetFormValue(formVar, fieldName, value, fieldIndex);
HTML_SetFormValue(formVar, fieldName, value, options);
HTML_SetFormValue(formVar, fieldName, value, fieldIndex, options);
HTML_SetFormValue(formVar, fieldName, value, options, sendvalue, contenttype);
HTML_SetFormValue(formVar, fieldName, value, fieldIndex, options, sendvalue, contenttype);

Parameters:

formVar

A form variable in which the field value is assigned.

fieldName

A string expression containing the form field name in which the value is assigned.

value

A string expression containing the value to be assigned. If the FILEVAR option is specified, the value parameter specified the path of the file to upload.

fieldIndex

If the form contains several fields that have the same name, the formFieldNameIndex specifies the rank index of the field to which the value is assigned.

options

Available options are:

FILEVAR The form parameter is a file whose path is specified in the value parameter. If the formVar variable is specified in the MULTIPART_FORM option of a HTTP POST command, the file is uploaded using the "multipart/form-data" protocol.

sendvalue

Available with options param equal to FILEVAR.
At request creation time, multipart filename field will be set to sendvalue.

contenttype

Available with options param equal to FILEVAR.
Specify the content type.

Example:

FORM formVar;

// Set the field "Name" to value "John" into formVar
HTML_SetFormValue(formVar, "Name", "John");
// Add a file to upload in the the form variable
HTML_SetFormValue(formVar, "FileName", "c:\\temp\\agileload.gif", FILEVAR);
// Add a file to upload in the the form variable, the upload file will have "logo" filename
HTML_SetFormValue(formVar, "FileName", "c:\\temp\\agileload.gif", FILEVAR, "logo", "image/gif");

See also:





Go back to the Learning center:


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