[Webtest] Re: Cookies and Redirection

work webtest@lists.canoo.com
Tue, 16 May 2006 13:59:23 -0400


Here is the login.xml file that I am running: 

<antWrapper>
 <echo message="Starting login.xml" />
</antWrapper>
<invoke description="Log In to Apps"
       url="" />
<antWrapper>
 <echo message="invoke step complete" />
</antWrapper>
<setInputField description="Enter the User Name"
              name="j_username"
              value="${valid.uid}" />
<antWrapper>
 <echo message="filled out j_username" />
</antWrapper>
<setInputField description="Enter the Password"
              name="j_password"
              value="${valid.pwd}" />
<antWrapper>
 <echo message="********************************* filled out j_password" />
</antWrapper>
 <groovy description="Change cookie policy to: ignore cookies">
   import org.apache.commons.httpclient.cookie.CookiePolicy
   import org.apache.commons.httpclient.params.* 

   ((HttpClientParams)
 DefaultHttpParams.getDefaultParams()).setCookiePolicy(CookiePolicy.BROWSER_ 
COMPATIBILITY);
 </groovy>
<clickButton description="Click the 'Log In' Button"
            label="Log In" />
<storeCookie name="JSESSIONID" property="sessioncookie" description="storing 
session cookie"/>
<antWrapper>
 <echo message="********************************* Clicked Log In Button" />
</antWrapper>
<verifyText description="Main Menu Page - Or Bookmarked Page should be 
displayed"
            text="${login.page.text}" /> 

The above is inside of: 

<?xml version="1.0"?>
<!DOCTYPE project [
<!ENTITY config SYSTEM "file:../modules/config.xml">
<!ENTITY login  SYSTEM "file:../modules/login.xml">
<!ENTITY logout SYSTEM "file:../modules/logout.xml">
]> 

<project name="logintests" basedir="." default="loginTests">
	<target name="loginTests">
		<webtest name="Log In Test - Successful">
			&config;
			<steps>
				&login;
				&logout;
			</steps>
		</webtest>
	</target>
</project> 


Marc Guillemot writes: 

> have you tried to change the cookie policy? I can't see it in the log
> you provided. 
> 
> Marc.
> _______________________________________________
> WebTest mailing list
> WebTest@lists.canoo.com
> http://lists.canoo.com/mailman/listinfo/webtest