There are 2 other options: 1) Write all related tests within the same test file 2) Create macros out of common actions (such as login) and reuse those macros across tests. The first test will test login, the second test will use the login macro to log in again and proceed further.
Cheers, John Spann Software Engineer Citrix Online | 6500 Hollister Avenue | Goleta, CA 93117 T: +1 805 690 3489 | M: +1 805 729 0008 [email protected]<x-msg://29/[email protected]> http://www.citrixonline.com<http://www.citrixonline.com/> [cid:[email protected]] Access Your PC From Anywhere: www.gotomypc.com<http://www.gotomypc.com/> Online Meetings Made Easy: www.gotomeeting.com<http://www.gotomeeting.com/> Remote Support Made Easy: www.gotoassist.com<http://www.gotoassist.com/> Web Events Made Easy: www.gotowebinar.com<http://www.gotowebinar.com/> On Nov 10, 2009, at 8:17 AM, Marc Guillemot wrote: 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]<mailto:[email protected]> http://lists.canoo.com/mailman/listinfo/webtest _______________________________________________ WebTest mailing list [email protected]<mailto:[email protected]> http://lists.canoo.com/mailman/listinfo/webtest _______________________________________________ WebTest mailing list [email protected]<mailto:[email protected]> http://lists.canoo.com/mailman/listinfo/webtest
<<inline: image001.png>>

