Parsing Functions

Parsing commands offer different ways to extract values from HTML, XML, or any text document. Most of those commands can be either integrated into HTTP/S requests or executed independently.

Example:

In a Navigate request (subrequest management)

NAVIGATE "http://demo.fmstocks.com//fmstocks/default.asp" IDENTIFIER 10
    FINANCIAL_NEWS = HTML_GetUrl(GetSubRequestContent("http://demo.fmstocks.com/fmstocks/home.asp", 1, NOCASE), "financial news");

In an HTTP request:

HTTP GET HOST "demo.fmstocks.com" URL "/fmstocks/home.asp" IDENTIFIER 10 FINANCIAL_NEWS = HTML_GetUrl(CONTENT, "financial news");

Independently:

HTTP GET HOST "demo.fmstocks.com" URL "/fmstocks/home.asp" IDENTIFIER 10 FULL_BODY = GetContent();
FINANCIAL_NEWS = HTML_GetUrl(FULL_BODY, "financial news");

If the function is not attached to an HTTP request, the first parameter is the input character string on which the function is applied.

The different parsing functions are listed below:

General functions:

GetStatus Sets the request HTTP status code in an integer variable.
GetHeader Sets all the HTTP headers or a single HTTP header in a character string variable.
GetContentLength Sets the document length in an integer variable.
GetContent Sets the document content in a character string variable.
SubStr Sets a part of the document in a character string variable.

Subrequests and Frames functions (for Navigate and Submit commands):

GetSubrequestContent Sets the content of a subrequest in a character string variable.  
GetSubrequestHeader Sets the HTTP headers of a subrequest in a character string variable.  
GetFrameContent Sets the content of a frame subrequest in a character string variable.  
GetFrameHeader Sets the HTTP headers of a frame subrequest in a character string variable.   

HTML Parsing functions:

HTML_GetElement Sets an HTML tag content in a character string variable.
HTML_GetElementText Sets an HTML tag text value in a character string variable.
HTML_GetElementAttribute Sets an HTML tag attribute value in a character string variable.
HTML_GetUrl Sets an Url (href attribute of a <A> tag) based on its displayed value in a character string variable.
HTML_GetTable Sets an HTML table in an array of character string variable.
HTML_GetTableElement Sets an HTML table cell in a character string variable.
HTML_GetForm
HTML_GetFormByName
HTML_GetFormByURL
Sets an HTML Form content in a FORM variable.
HTML_GetFormValue
HTML_GetFormValueByName
HTML_GetFormValueByURL
Sets an HTML Form field value in a character string variable.
HTML_GetFormValueList
HTML_GetFormValueListByName
HTML_GetFormValueListByURL
Sets an HTML Form field value list in an array of character string variable.

XML Parsing functions:

XML_GetElement Sets an XML tag content in a character string variable.
XML_GetElementText Sets an XML tag text value in a character string variable.
XML_GetElementAttribute Sets an XML tag attribute value in a character string variable.




Go back to the Learning center:


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