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
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.
Welcome
Introduction: Testing Basics
Performance, Load or Stress Testing?
Calculation of Load and Load Pattern
Webserver Stress Tool Features
How much load can Webserver Stress Tool generate?
Installation
Configuring Webserver Stress Tool
Selecting the Test Type and the Number of Users
Selecting the URLs or Editing the URL Script
Using Custom URL Scripts for Advanced URL Sequences
Performance Tips&Tricks
Running the Test
Reviewing Logfile Results
Analyzing Graphical Results
Graph Click Times & Errors (per URL)
Graph Click Times, Hits/s and Clicks/s
Graph Server and User Bandwidth
Creating Reports
Additional Features
Appendix
Software License and Contact Information