HTML_GetElementAttribute Function

Description:

The HTML_GetElementAttribute function returns a HTML attribute content.
The HTML tag location containing the HTML attribute to be retrieved can be specified by:

Format:

HTTP GET HOST Hostname URL url szVar = HTML_GetElementAttribute(options, tag, tagIndex, attribute);
HTTP GET HOST Hostname URL url szVar = HTML_GetElementAttribute(options, path, attribute);
szVar = HTML_GetElementAttribute(inputHtml, tag, tagIndex, attribute);
szVar = HTML_GetElementAttribute(inputHtml, path, attribute);

Parameters:

szVar

A string variable into which the attribute value will be loaded.

options

Available options are:

CONTENT  The function is applied on the current HTTP response 

tag

A string expression containing the name of the HTML tag (without '<' and '>') which contains the attribute to retrieve.

tagindex

An integer expression containing the HTML tag index in the HTML document.

path

A string expression containing the path of the HTML tag (tag(tagnum){/tag(tagnum)}) which contains the attribute to retrieve.

attribute

A string expression containing the name of the attribute whose value must be found.

inputHtml

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

Example:

STRING szVar;
STRING szHTML;

HTTP GET HOST "demo.fmstocks.com" URL "/fmstocks/home.asp" szVar = HTML_GetElementAttribute(content, "IMG", 1, "SRC");
HTTP GET HOST "demo.fmstocks.com" URL "/fmstocks/home.asp" szVar = HTML_GetElementAttribute(content, "HTML(1)/BODY(1)/TABLE(1)/TR(1)/TD(1)/IMG(1)", "SRC");

HTTP GET HOST "demo.fmstocks.com" URL "/fmstocks/home.asp" szHTML = GetContent();
szVar = HTML_GetElementAttribute(szHTML, "IMG", 1, "SRC");
szVar = HTML_GetElementAttribute(szHTML, "HTML(1)/BODY(1)/TABLE(1)/TR(1)/TD(1)/IMG(1)","SRC");

See also:





Go back to the Learning center:


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