Hi,
I'm not sure whether the macro (macrodef) is the best solution.
Because in case you use for example the ANT SQL
<antWrapper>
<sql ...>
<transaction src="../script.sql" />
</sql>
</antWrapper>
You can't use the @{username} in script.sql. But the ${variable} or
#{variable} can be used without problem.
The antWrapper or sql src or I don't know what - it does not recognize
the variables like @{variable}.
I usually use a properties file (file.properties) to set the default
values and then I use for every testcase their own config file (of
course only in case it's needed.), where the typical variables for
testcase are in or where I modify the default variable - I only set the
new value in this config file for each testcase).
<project name="my_project" ...>
<property file="properties/file.properties"/>
<target name="TestCase">
<webtest name="blabla">
<steps>
&config;
&login;
...
</steps>
</webtest>
</target>
</project>
Regards,
Mato
On 11.11.2010 20:05, [email protected] wrote:
> Re: [Webtest] Help with log in test cases
>
> Subject:
> Re: [Webtest] Help with log in test cases
> From:Murat <[email protected]>
> Date: Thu, 11 Nov 2010 13:10:41 +0100
> To: [email protected]
>
> Hi,
>
> why not use macro definitions with attributes for the credentials?
> Then, you can define different properties for the various users and
> choose the appropriate one when using the macro in the tests.
> Additionally, you could have the common user as the default value of
> the attributes.
>
> Regards,
> murat
_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest