Indeed, as Murat sugests, I use a macro:

<macrodef name="loginIssuer" description="perform a login for the provided
user and password">
    <attribute name="username"/>
    <attribute name="password"/>
    <sequential>
        <invoke description="get Login Page" url="/"/>
        <verifytitle description="we should see the login title"
text=".*${login.title}.*" regex="true"/>
        <setinputfield description="set user name" name="j_username"
value="@{username}"/>
        <setinputfield description="set password" name="j_password"
value="@{password}"/>
        <clickbutton label="${button.login}" description="Click the submit
button"/>
        <!--
        <verifytitle description="Home Page follows if login ok"
text=".*${userDocumentList.title}.*" regex="true"/>
        -->
    </sequential>
</macrodef>

Josep


2010/11/11 Iain_10 <[email protected]>

>
> Hi,
>
> To use our web site we need to log in using a username and password. For
> the
> majority of our tests, we use the same username and password and I have
> defined this in the build.xml file and use it as a variable in each of my
> test cases.
> This works without any problems. (1).
>
> I have added some tests where I use different user names and passwords.
> I define the username and password as a property at the start of each test
> case .xml file.
>
> I'd like to run all my tests together but when I use the build.xml from 1
> above,
> it uses the username and password defined in the build.xml file and not the
> one
> from the test case .xml file.
>
> Any suggestions/idea's on how I can get all my tests to run together and
> use
> the
> different usernames and passwords?
>
> thanks!
> --
> View this message in context:
> http://old.nabble.com/Help-with-log-in-test-cases-tp30189200p30189200.html
> Sent from the WebTest mailing list archive at Nabble.com.
>
> _______________________________________________
> WebTest mailing list
> [email protected]
> http://lists.canoo.com/mailman/listinfo/webtest
>

Reply via email to