Extracting a Web Page's Content

During a Job-run, a web page's content, an HTTP header, an HTTP status code and a web page size can be dynamically recovered. This enables the dynamic modeling of some Web sites.

This can be done by adding a parsing function to a NAVIGATE, SUMBIT, GET or a POST statement.

NAVIGATE "http://demo.fmstocks.com/fmstocks/home.asp" IDENTIFIER 11
   
FINANCIAL_NEWS = HTML_GetUrl(CONTENT, "financial news");

The Parse view, located at the bottom of the HTTP window, helps add a parsing function to extract data from:

Click the button to add the parsing function specified at the bottom of the view in the script.


Extract
ing a value starting from the Script

  1. Click an insertion point inside the HTTP request in the script.

  2. Click the button (or the "Tools/Request details" menu option or "Request details" from the contextual menu).
    or
    Select one of the Extract value menus (in the contextual menu or in the edit menu).

    • From body... ( toolbar icon)
    • From header... ( toolbar icon)
    • Content length...
    • status code...

 

  1. The HTTP data window is updated with the web page corresponding to the selected HTTP request.


     
  2. Fill the Parse view.
     
  3. Click ; the parsing function is added to the selected HTTP request.

NAVIGATE "http://demo.fmstocks.com/fmstocks/home.asp" IDENTIFIER 11
    WelcomeVar = HTML_GetElementText(CONTENT, "SPAN", 2, 1);
 

Extracting a value starting from the HTML/XML view

The Parse view can be compiled manually.
It can also be compiled starting from the HTML and XML tree views.

  1. Select an item in the HTML tree view, in the XML tree view or in an HTTP header.
  2. Select the "Extract value" from the contextual menu.
  3. The view is automatically filled with the options corresponding to the selected item.


     
  4. Click ; the parsing function is added to the selected HTTP request.

 NAVIGATE "http://demo.fmstocks.com/fmstocks/home.asp" IDENTIFIER 11
    WelcomeVar = HTML_GetElementText(CONTENT, "SPAN", 2, 1);
 

See also:

 





Go back to the Learning center:


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