See if this helps.  You can use the <condition> tags which is a "Group of steps 
which if successful should cause inner steps to be executed."  Below is an 
example:

<storeProperty property="test" value="200" eval="false"/>
<ifStep>
        <condition>
                <verifyProperty property="test" text="200"/>
        </condition>
        <invoke url=""/>
</ifStep>

If you set the property #{test} to 20 then the invoke will never occur because 
the condition failed but if it is set to 200 like I have it, the invoke will 
occurr because the condition passed.


William Soula
QA Analyst

Pointserve, Inc.
110 Wild Basin Road
Suite 300
Austin, Texas 78746
O: 512.617.5311
F: 512.617.0466

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Douglas Beattie
Sent: Tuesday, February 12, 2008 3:39 PM
To: [email protected]
Subject: [Webtest] Help needed on <ifStep ... />

I have a test with the following in it:
-----------------------------------------------------------------------
<?xml version="1.0"?>

<!DOCTYPE project SYSTEM "../../dtd/Project.dtd"> <project 
name="getMeWithValidSessionId" default="test">
  <target name="test">
    <webtest name="Get 'Me' With Valid SessionId">
        <config>
          <option name="ThrowExceptionOnFailingStatusCode" value="false"/>
        </config>
        <steps>
          <invoke url="http://${HOST}:${PORT}/identity/${VERSION}/login"; 
username="${VALIDUSER}" password="${VALIDPASSWORD}"
            description="Get 'Me' With Valid SessionId"
          />
          <verifyXPath
            description="Check login status code equals 200"
            xpath="//@statusCode='200'"
          />
          <storeXPath
            description="Extract StatusCode"
            property="StatusCode"
            xpath="//@statusCode"
          />
          <echo message="#{StatusCode}"/>

          <ifStep description="if StatusCode == 200 do the following:" 
test="#{StatusCode}==200">
            <storeXPath
              description="Extract session ID for use with future calls"
              property="sessionID"
              xpath="//@id"
            />
            <echo message="#{sessionID}"/>

            ...


I am wondering how to get a "test=" evaluation done to see if the StatusCode is 
equal to 200 before proceeding. The examples I've seen only evaluate a boolean 
test value.
How can I use "test=" to work with an evaluation?

Thanks,
Doug

----------------------------------------------------------------------
NOTICE: This email message is for the sole use of the intended recipient(s) and 
may contain confidential and privileged information. Any unauthorized review, 
use, disclosure or distribution is prohibited. If you are not the intended 
recipient, please contact the sender by reply email and destroy all copies of 
the original message.
_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest
_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest

Reply via email to