The beginAt method needs to be called first.  This will initialize the
dialog.

I would recommend moving that line into your "test" methods after the
beginAt() method is called.

Actually, in our superclass we implemented an "authenticateApplication()"
method called at the setUp() method.

//////////////////////////////////
        public void setUp() throws Exception {
                super.setUp();
                getTestContext().setBaseUrl("http://localhost:8080";);

                authenticateApplication();
        }

        public void authenticateApplication() {
        
beginAt("/ims/servlet/Login?COLLABORATION=login&OPERATION=display&TARGET=hom
e");

                //your line of code after the beginAt.
        
getDialog().getWebClient().getClientProperties().setAutoRedirect(true);

                assertTitleEquals("IMS Login");

                setFormElement("userId", getUserId());
                setFormElement("password", getUserPass());

                //submit("login-button");
                submit();

                assertTitleEquals("Ims Home");

        }

//////////////////////////////////////

Hope this Helps, HTH.

Nick



> -----Original Message-----
> From: Alistair Young [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, March 08, 2005 10:43 AM
> To: jwebunit-users@lists.sourceforge.net
> Subject: [Jwebunit-users] getDialog
> 
> 
> Hello folks,
> I'm trying to follow redirects by using:
> 
> public class Test extends WebTestCase {
>    public void setUp() throws Exception {
>      super.setUp();
>      getTestContext().setBaseUrl("http:/somesite.org");
>      
> getDialog().getWebClient().getClientProperties().setAutoRedire
> ct(true);
>    }
> }
> 
> but getDialog always returns null
> 
> is there something I'm missing?
> 
> thanks,
> Alistair
> 
> 
> 
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from 
> real users.
> Discover which products truly live up to the hype. Start reading now.
> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> _______________________________________________
> Jwebunit-users mailing list
> Jwebunit-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jwebunit-users
> 


- - - - - - 
This e-mail message is intended only for the use of the individual or entity
identified in the alias address of this message and may contain confidential
and privileged information. Any unauthorized review, use, disclosure or
distribution of this e-mail message is strictly prohibited. If you have
received this e-mail message in error, please notify the sender immediately
by reply e-mail and delete this message from your system. Thank you.


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Jwebunit-users mailing list
Jwebunit-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jwebunit-users

Reply via email to