Support Requests item #1003666, was opened at 2004-08-04 19:18
Message generated for change (Comment added) made by jimweaver
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=497983&aid=1003666&group_id=61302

Category: None
Group: None
>Status: Pending
Priority: 5
Submitted By: Kevin Hutson (mrjabba)
Assigned to: Nobody/Anonymous (nobody)
Summary: How to handle a page with a META Refresh to another URL

Initial Comment:
I am trying to use jWebUnit 1.2 to test through a site.
I am able to get to the login page, input the username
and password and submit using jWebUnit.
However, the next response I get back is a simple
response with a META Refresh in it.
It is unclear to me how to handle the response as the
Refresh does not seem to occur. I need to get to the
next page after the Refresh (or redirect) so I can fill
out another form.
Thanks for any samples you can point me to on handling
pages which include the META Refresh to another URL.

Below is the sample HTML.

<HTML>
<!-- File: redirectmeta.html -->
<HEAD>
<TITLE>FOO - Redirection</TITLE>
<META HTTP-EQUIV="Refresh" CONTENT="0;
URL=/fooNextPage.html">
</HEAD>
</HTML>
<!-- End File: redirectmeta.html -->


----------------------------------------------------------------------

>Comment By: Jim Weaver (jimweaver)
Date: 2004-09-16 15:04

Message:
Logged In: YES 
user_id=619947

I'm not certain, but I think this could be an HttpUnit
problem.  See:
http://sourceforge.net/tracker/index.php?func=detail&aid=803041&group_id=6550&atid=106550

(bug fix to metarefresh in HttpUnit that is pending for
1.5.5 release)

----------------------------------------------------------------------

Comment By: Kevin Hutson (mrjabba)
Date: 2004-08-05 11:29

Message:
Logged In: YES 
user_id=166965

Hi Vasile, 

Thanks for the quick response. I really appreciate the help.

assertTitleEquals("Foo - Redirection");
System.out.println("yep..redirecting");
getDialog().getWebClient().getClientProperties().setAutoRedirect(true);
assertTitleEquals("Foo - myPage");

Your statement was what I was trying last night.
However, that doesn't seem to work. The last statement
assertTitleEquals does not find the new page after the redirect.
Am I calling setAutoRedirect in the right place? When should
this command be issued? What actually makes the process move
on to the next page because there is no link to click or
form to submit.

Also, I would like to clarify our understanding. The issue
is that I get back a page with a META Refresh type of redirect.
So, I get a HTTP 200 OK back not a 302. And the redirect is
done as a matter of the META tag.

----------------------------------------------------------------------

Comment By: Vasile Alaiba (alaiba)
Date: 2004-08-05 06:41

Message:
Logged In: YES 
user_id=715621

You should set httpunit to follow redirects. Do this by 
retrieving the HttpUnitDialog and set the AutoRedirect 
property to true in the web client.

Most probably your code should look like this:
getDialog().getWebClient().getClientProperties
().setAutoRedirect(true)

HTH,
Vasile

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=497983&aid=1003666&group_id=61302


-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
Jwebunit-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jwebunit-users

Reply via email to