[Webtest] new custom steps VerifyHeader and StoreHeader added to community site

Paul King webtest@lists.canoo.com
Fri, 13 Aug 2004 18:51:49 +1000


http://webtest-community.canoo.com/wiki/space/StoreHeader%26VerifyHeader

StoreHeader and VerifyHeader

These custom steps allow storing/checking request header fields. To make 
use of the storeHeader step, you will most likely need to use the 
VerifyProperty custom step.

Note: If the VerifyProperty step (or something similar) becomes part of 
the main distribution, then it might be best to remove the verifyHeader 
step which can be simulated using storeHeader followed by verifyProperty.

Example:

   <steps>
     <invoke stepid="Load Initial Page" url="/"/>
     <storeHeader stepid="get server header field"
       field="SERVER" property="serv"/>
     <verifyProperty stepid="check we are running on our prod server"
       property="serv" regex="true" text="WebLogic Server.*"/>
     <invoke stepid="Load Image" url="resources/images/linevertical.gif"/>
     <storeHeader stepid="find content-length"
       field="Content-Length" property="initContentLength"/>
     <verifyProperty stepid="should find this header if server is 
working correctly"
       property="initContentLength" regex="true" text=".*"/>
     <!-- now re-check content-size under repeated calls -->
     <repeat count="4">
       <invoke stepid="Load Image - iteration #{count}" 
url="resources/images/linevertical.gif"/>
       <verifyHeader stepid="check content-length under repeated calls"
         field="Content-Length" text="#{initContentLength}"/>
     </repeat>
   </steps>