You are right. With your HTMLUnit code I get (as pasted below). Any Idea how I
should proceed. When I view source on the html page it looks like any html page.
=====================================================
<html>
<head>
<title>MyApp</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Page-Enter" content="RevealTrans(Duration=0,Transition=0)">
<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="0">
<link rel="SHORTCUT ICON" href="resources/images/favicon.ico">
</head>
<script>
if
(window.location.href.toLowerCase().indexOf('http://localhost:8080/cc/MyApp.do'.toLowerCase())
== -1) {
window.location.href = 'http://localhost:8080/cc/MyApp.do';
}
</script>
<frameset id="toplevel_frameset" border="1" bordercolor="#000000"
frameborder="1" framespacing="0" topmargin="0" leftmargin="0" marginheight="0"
marginwidth="0" rows="100%,0,0,0,0">
<frame name="top_frame" id="top_frame" frameborder="0" scrolling="no"
src="http://localhost:8080/cc/MyApp.do?inFrame=mainframe&r=36512022"/>
<%--These both have to be 0x0 in size instead of hidden, because we need to
type on them with the ActiveX control--%>
<frame name="upload_frame" id="upload_frame"
src="http://localhost:8080/cc/MyApp.do?inFrame=uploadframe&r=36512022"
width="0" height="0" noresize/>
<frame name="document_frame" id="document_frame"
src="http://localhost:8080/cc/MyApp.do?inFrame=documentframe&r=36512022"
width="0" height="0" noresize/>
<%--This frame exist for use when some javascript needs a hidden frame to
target. Nothing should ever assume that its contents are in a particular state,
and it may be overwritten at any time--%>
<frame name="utility_frame" id="utility_frame"
src="http://localhost:8080/cc/MyApp.do?inFrame=blank&r=36512022" width="0"
height="0" noresize/>
<frame name="spellcheck_frame" id="spellcheck_frame"
src="http://localhost:8080/cc/MyApp.do?inFrame=scframe&r=36512022" width="0"
height="0" noresize/>
</frameset>
</html>
===================================================
Julien HENRY <[EMAIL PROTECTED]> wrote:
It seems the page is not HTML content. Are you using a kind of
client-side XSL transformation?
Could you spy what your server send to you? You can use a tool like TCPMon.
You can also try the following HtmlUnit code:
WebClient wc = new WebClient();
Page p = wc.getPage("http://localhost:8080/cc/MyApp.do");
System.out.println(p.getWebResponse().getContentType());
System.out.println(p.getWebResponse().getContentAsString());
----- Message d'origine ----
De : Modha Kumar <[EMAIL PROTECTED]>
À : Usage problems for JWebUnit <[email protected]>
Envoyé le : Mercredi, 7 Mars 2007, 18h33mn 39s
Objet : Re: [JWebUnit-users] Re : setBaseUrl problem
Thanks for the reply. When I try that I get
Mar 7, 2007 10:30:11 AM net.sourceforge.jwebunit.htmlunit.HtmlUnitDialog$1
webWindowContentChanged
INFO: Window "" changed : "no_html" became "no_html"
I also see Java.lang.ClassCastException
com.gargoylesoftware.htmlunit.UnexpectedPage.
Julien HENRY <[EMAIL PROTECTED]> wrote:
Hi,
setBaseUrl should be used to avoid writing base url each time.
Try this:
public void setUp() {
setTestingEngineKey(TestingEngineRegistry.TESTING_ENGINE_HTMLUNIT);
getTestContext().setBaseUrl("http://localhost:8080/cc/");
}
public void testSearch() throws Exception {
beginAt("/MyApp.do");
----- Message d'origine ----
De : Modha Kumar <[EMAIL PROTECTED]>
À : [email protected]
Envoyé le : Mercredi, 7 Mars 2007, 17h18mn 14s
Objet : [JWebUnit-users] setBaseUrl problem
Hi All
How can I avoid Jwebunit appending / at the end of url
http://localhost:8080/cc/MyApp.do works however when url is changes to
http://localhost:8080/cc/MyApp.do/ it does not.
Here is my program. Now i get http status 404 because of / appended at end.
public void setUp() {
setTestingEngineKey(TestingEngineRegistry.TESTING_ENGINE_HTMLUNIT);
getTestContext().setBaseUrl("http://localhost:8080/cc/MyApp.do");
}
public void testSearch() throws Exception {
beginAt("/");
assertFormPresent("mainForm");
setTextField("user", "su");
setTextField("pass", "pass");
clickButtonWithText("Login");
Please let me know.
Thanks
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
JWebUnit-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jwebunit-users
---------------------------------
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions !
Profitez des connaissances, des opinions et des expériences des internautes sur
Yahoo!
Questions/Réponses.-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV_______________________________________________
JWebUnit-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jwebunit-users
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
JWebUnit-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jwebunit-users
---------------------------------
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions !
Profitez des connaissances, des opinions et des expériences des internautes sur
Yahoo!
Questions/Réponses.-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV_______________________________________________
JWebUnit-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jwebunit-users
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
JWebUnit-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jwebunit-users