Hi Giordan,

The best way I know to do something analogous to your needs is via an
Ant-Macro.
Try something like this:
1) record an ant-macro into your project (best if in an external xml file that
will be imported in your script):

          <macrodef name="configuration">
               <attribute name="hostname"/>
               <attribute name="portname"/>
               <attribute name="protocolname"/>
               <attribute name="basename" />
               <sequential>
                   <echo message=" The actual value passed are in order:
@hostname, @portname, @protocolname, @basename"/>
                   <config
                         host="@hostname"
                         port="@portname"
                         protocol="@protocolname"
                         basepath="@basename" />
               </sequential>
           </macrodef>

1) call the macro every time you need it like in
. . .
 <target name="main">
   <webtest name="myTest">
     <configuration hostname="www.google.it" portname="80"
protocolname="http" basename="${bpath}" />    (<--- look here)
     <steps>
       <invoke
         description="get Login Page"
         url="login" />
       <verifyTitle
         description="we should see the login title"
         text="Login Page" />
     </steps>
   </webtest>
   <webtest>
     <configuration hostname="www.email.it" portname="70"
protocolname="https" basename="${bpath}" />    (<--- look here)
    <steps>
       <invoke
         description="get Login Page"
         url="login" />
       <verifyTitle
         description="we should see the login title"
         text="Login Page" />
     </steps>
   </webtest>
 </target>
</project>

Greetings,
Vito

_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest

Reply via email to