HTML_GetElementText Function

Description:

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

Format:

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

Parameters:

szVar

A string variable into which the text 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 text 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 text to retrieve.

textIndex

A integer expression containing the index of the text in the tag specified by the above parameters.

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_GetElementText(content, "SPAN", 2, 1);
HTTP GET HOST "demo.fmstocks.com" URL "/fmstocks/home.asp" szVar = HTML_GetElementText(content, "HTML(1)/BODY(1)/TABLE(1)/TR(3)/TD(2)/TABLE(1)/TR(2)/TD(1)/SPAN(1)", 1);

HTTP GET HOST "demo.fmstocks.com" URL "/fmstocks/home.asp" szHTML = GetContent();
szVar = HTML_GetElementText(szHTML, "SPAN", 2, 1);
szVar = HTML_GetElementText(szHTML, "HTML(1)/BODY(1)/TABLE(1)/TR(3)/TD(2)/TABLE(1)/TR(2)/TD(1)/SPAN(1)", 1);

See also:





Go back to the Learning center:


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