Hi,
this is an usual Ant problem ("feature"?): property can't pop up when
you call <ant antfile...>
Two solutions:
- use an Ant extension that allow properties to be shared among
different build files
- write values to a file and read them from there
Cheers,
Marc.
Thorsten Plappert a écrit :
Hi Marc,
thanks for your answer. I removed the verifyCookie tag and now it works
as expected - but when I split the two tests into two separate files,
i.e. test1.xml and test2.xml, test2 fails because ${sessionId} can't be
evaluated. In short: I want to test a backend system and the user has to
be logged in to use the system. The first test is the login, all other
tests should test the functionality. Therefore I wrote an Alltest.xml as
follows:
<target name="all" description="runs all the tests">
<ant antfile="test1.xml"/>
<ant antfile="test2.xml"/>
</target>
As I mentioned before, test1 is responsible for logging in the user and
fetch the sessionId. testn (n = 2..) use the sessionId and do the tests.
But I can't use ${sessionId}, because the evaluation fails. Is there a
possibility to use the sessionId in all tests?
Regards,
Thorsten
Am Dienstag, den 10.11.2009, 15:23 +0100 schrieb Marc Guillemot:
Hi,
following sets a header, not a Cookie:
> <config>
> <header name="Cookie" value="PHPSESSID=${sessionId}"/>
> </config>
Ok, this is a Cookie header and it should be ok for the server, but this
is not a Cookie for the WebClient and therefore verifyCookie fails.
There is currently no "setCookie" step but it would be easy to program
it against HtmlUnit API.
Cheers,
Marc.
Thorsten Plappert a écrit :
Hi, I am trying to do a simple webtest (canoo webtest 2.6). The first
test does a login, and the second executes a simple search. Important is
the first, because I need the PHP session id. The second test can only
be executed successfully, if the PHP session id from the first test is
set as a cookie. I tried the following:
first test:
-----------
...
<storeCookie name="PHPSESSID" property="sessionId" propertyType="ant" />
<verifyCookie name="PHPSESSID" text="${sessionId}" />
</webtest>
second test:
------------
...
<webtest name="...">
<config>
<header name="Cookie" value="PHPSESSID=${sessionId}"/>
</config>
<invoke url="http://..." />
<verifyCookie name="PHPSESSID" text="${sessionId}" />
...
But this test failed with the message:
Message
No cookie available!
Apperently the sessionId isn't set as a Cookie (in this test) - but why?
Regards,
Thorsten
_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest
_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest
_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest