Window.open Error
Sai Surya <[email protected]> Tue, 10 May 2011 17:58:04 +0800
| Newsgroups | gmane.comp.web.httpunit.devel |
|---|---|
| Message-ID | <[email protected]> |
--===============1466473380084377155==
Content-Type: multipart/alternative;
boundary="_4d862a8c-a725-46fc-a8e4-bb69695ff5b3_"
--_4d862a8c-a725-46fc-a8e4-bb69695ff5b3_
Content-Type: text/plain; charset="gb2312"
Content-Transfer-Encoding: 8bit
Hi,
I am using HttpUnit 1.7 to test my web site. I am opening a new window using 'window.open' by clicking the button.
Getting the following exception.
java.lang.NoSuchFieldError: instance
at com.meterware.httpunit.javascript.JavaScript$JavaScriptEngine.toStringIfNotUndefined(JavaScript.java:364)
at com.meterware.httpunit.javascript.JavaScript$Window.jsFunction_open(JavaScript.java:546)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
I am opening popup like this: popup-test.html
<form name="testButtonForm">
<input type="button" ID="clickButton" name="clickButton" value="Tagit" onclick="javascript:window.open('http://www.google.com','google')"/>
</form>
I am using HttpUnit to open popup like this:
WebConversation wc = new WebConversation();
WebResponse resp = null;
WebForm form = null;
Button button = null;
WebLink link = null;
WebRequest req = new GetMethodWebRequest("http://localhost:8082/vb-scenarios/html/scenario-frame/popup-test.html");
try {
resp = wc.getResponse(req);
form = resp.getFormWithName("testButtonForm");
button = form.getButtonWithID("clickButton");
button.click();
} catch (Exception e) {
//Exception handling
}
Is there anything wrong with the above code, how do I get the response of the popup window.
Thanks in advance,
Surya.
--_4d862a8c-a725-46fc-a8e4-bb69695ff5b3_
Content-Type: text/html; charset="gb2312"
Content-Transfer-Encoding: 8bit
<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>
Hi,<br><br>I am using HttpUnit 1.7 to test my web site. I am opening a new window using 'window.open' by clicking the button. <br>Getting the following exception.<br><br>java.lang.NoSuchFieldError: instance<br> at com.meterware.httpunit.javascript.JavaScript$JavaScriptEngine.toStringIfNotUndefined(JavaScript.java:364)<br> at com.meterware.httpunit.javascript.JavaScript$Window.jsFunction_open(JavaScript.java:546)<br> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)<br> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)<br> at java.lang.reflect.Method
.invoke(Method.java:597)<br><br><br><b>I am opening popup like this:</b> <b>popup-test.html</b><br><form name="testButtonForm"><br> <input type="button" ID="clickButton" name="clickButton" value="Tagit" onclick="javascript:window.open('http://www.google.com','google')"/><br></form><br><br><b>I am using HttpUnit to open popup like this:</b><br> WebConversation wc = new WebConversation();<br> WebResponse resp = null;<br> WebForm form = null;<br> Button button = null;<br> WebLink link = null;<br> <br> &
nbsp; WebRequest req = new GetMethodWebRequest("http://localhost:8082/vb-scenarios/html/scenario-frame/<b>popup-test.html</b>");<br> try {<br> <br> resp = wc.getResponse(req);<br> form = resp.getFormWithName("testButtonForm"); <br> button = form.getButtonWithID("clickButton"); <br> button.click();<br>&nbs
p; } catch (Exception e) {<br> //Exception handling<br> }<br><br>Is there anything wrong with the above code, how do I get the response of the popup window.<br><br><br>Thanks in advance,<br>Surya.<br> <br> </body>
</html>
--_4d862a8c-a725-46fc-a8e4-bb69695ff5b3_--
--===============1466473380084377155==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
------------------------------------------------------------------------------
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay
--===============1466473380084377155==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
Httpunit-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/httpunit-develop
--===============1466473380084377155==--