Hi, Michael!
The problem is that one session is visible only under a <webtest> tags. In your example tehre two <webtest> sections: one for each file. For such case we use an Entity construction: all steps described in a separate files (login.xml, sendmessage.xml) - not in <webtest> tag. Then in main webtest.xml file we use the following:
<!DOCTYPE project
[
   <!ENTITY config SYSTEM "file:../modules/webtest-config.xml">
<!ENTITY loginValidUser SYSTEM "file:../modules/login/loginValidUser.xml"> <!ENTITY loginUserWithInvalidName SYSTEM "file:../modules/login/loginUserWithInvalidName.xml"> <!ENTITY loginUserWithInvalidPassword SYSTEM "file:../modules/login/loginUserWithInvalidPassword.xml"> <!ENTITY createReportFromDataView SYSTEM "file:../modules/reports/createReportFromDataView.xml"> <!ENTITY addColumnToReport SYSTEM "file:../modules/reports/addColumnToReport.xml"> <!ENTITY addRowToReport SYSTEM "file:../modules/reports/addRowToReport.xml"> <!ENTITY deleteRowFromReport SYSTEM "file:../modules/reports/deleteRowFromReport.xml"> <!ENTITY deleteColumnFromReport SYSTEM "file:../modules/reports/deleteColumnFromReport.xml">
   <!ENTITY renameReport SYSTEM "file:../modules/reports/renameReport.xml">
....
]>
so, common test looks like:
<target name="full-test-macros">
       <webtest name="full-test-macros">
           &config;
           <steps>
               &loginUserWithInvalidName;
               &loginUserWithInvalidPassword;
               &loginValidUser;
               &createReportFromDataView;
               &addColumnToReport;
               &addRowToReport;
               &deleteColumnFromReport;
               &deleteRowFromReport;
               &checkQuickFiltersPresence;
             </steps>
       </webtest>
   </target>

where &<name.xml> is reference to name described in Entity section - and all works, session doesn't get lost. I don't think that this is optimal. And if you find less complicated way to organize steps this will be perfect.

Regards
Andrew.

What is the correct way to stay logged in to my web application from step-to-step?

When I have

<project name="WebTestDemo-allTests" default="test">

            <target name="test" description="runs all the tests">

                        <ant antfile="Login.xml"/>

                        <ant antfile="SendMessage.xml"/>

            </target>

</project>

The first file logs me in. But when the second file runs, it is back to the application login page. How to I stay logged into my application between groups of steps?

Regards,

Michael Clarage

CTO, Concentrica

781-890-1300


begin:vcard
fn:Andrew Sickorsky
n:Sickorsky;Andrew
org:texunatech
adr;dom:;;Magistralnaya street, 5 - 33;Moscow
email;internet:[EMAIL PROTECTED]
title:Tester
tel;work:+7 495 9809067
tel;cell:+7 909 9070328
x-mozilla-html:TRUE
url:www.texunatech.com
version:2.1
end:vcard

Reply via email to