Support Requests item #1003666, was opened at 2004-08-04 19:18
Message generated for change (Comment added) made by mrjabba
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=497983&aid=1003666&group_id=61302
Category: None
Group: None
Status: Open
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: 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 OSTG. Have you noticed the changes on
Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now,
one more big change to announce. We are now OSTG- Open Source Technology
Group. Come see the changes on the new OSTG site. www.ostg.com
_______________________________________________
Jwebunit-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jwebunit-users