Webserver Stress Tool - User Manual

Reading a TOKEN from a page and reusing it on subsequent requests

The following script shows how to read some data from the HTML of a page and the use this data in subsequent requests:

' =================================================================

' Webserver Stress Tool V7 *** Sample Script for Reusing a Token

' =================================================================

' Requires Webserver Stress Tool 7.0.2 or later

 

Sub OnBeforeClick

 

   if data.clickcount=0 then data.url="http://walldorf.paessler.com" end if

   if data.clickcount=1 then data.url="http://walldorf.paessler.com/?test="+data.token end if

   data.log="Preparing click #"+inttostr(data.clickcount+1)+" of user #"+inttostr(data.usernumber+1)

 

end Sub

 

Sub OnAfterClick

  data.log=""

end sub

 

Sub OnbeforeRequest

  data.log=""

end sub

 

 

Sub OnAfterRequest

 

  if data.clickcount=0 then 'we only look in the HTML of the first click for our tags

    if data.requestcount=0 then 'we only look in the HTML of the first request of the first click for our tags

 

      tagbefore="<title>"

      tagafter="</title>"   'our tag/token delimiters

 

      if pos(tagbefore,request.html)>0 then

        if pos(tagafter,request.html)>0 then

          tagbegin=pos(tagbefore,request.html)+length(tagbefore)

          taglength=pos(tagafter,request.html)-tagbegin

          mytag=copy(request.html,tagbegin,taglength)

          data.log="FOUND TOKEN: '"+mytag+"'"

          data.token=mytag

        else

          data.log="Closing Token not found ("+tagafter+") in request number "+inttostr(data.requestcount)+" with resultcode "+inttostr(request.resultcode)+" ("+request.result+")"

        end if             

      else

        data.log="Opening Token not found ("+tagbefore+") in request number "+inttostr(data.requestcount)+" with resultcode "+inttostr(request.resultcode)+" ("+request.result+")"

      end if

 

    end if

  end if

 

end sub

 

What is Webserver Stress Tool?

Webserver Stress Tool is a powerful HTTP-client/server test application designed to pinpoint critical performance issues in your web site or web server that may prevent optimal experience for your site's visitors.

Learn more, Freeware Download

 

Webserver Stress Tool - Manual - Table of Content

Welcome

Introduction: Testing Basics

Webserver Stress Tool Features

Installation

Configuring Webserver Stress Tool

Performance Tips&Tricks

Running the Test

Reviewing Logfile Results

Analyzing Graphical Results

Creating Reports

Additional Features

Appendix

Software License and Contact Information

More Information about Paessler Products