From: Vinay M. <vin...@gm...> - 2004-10-14 15:46:42
|
Hi, I am new to htmlunit. I was trying to use htmlunit to log into my mail account, but encountered the following exception trace: java.net.ConnectException: Connection timed out: connect at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(Unknown Source) at java.net.PlainSocketImpl.connectToAddress(Unknown Source) at java.net.PlainSocketImpl.connect(Unknown Source) at java.net.Socket.connect(Unknown Source) at java.net.Socket.connect(Unknown Source) at java.net.Socket.<init>(Unknown Source) at java.net.Socket.<init>(Unknown Source) at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:105) at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:663) at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:661) at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:529) at com.gargoylesoftware.htmlunit.HttpWebConnection.getResponse(HttpWebConnection.java:149) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponse(WebClient.java:1302) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponse(WebClient.java:1281) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponse(WebClient.java:1343) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponse(WebClient.java:1281) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponse(WebClient.java:1343) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:523) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:454) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:326) at com.gargoylesoftware.htmlunit.javascript.host.Window.jsSet_location(Window.java:302) at com.gargoylesoftware.htmlunit.javascript.host.Location.jsSet_href(Location.java:75) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.mozilla.javascript.ScriptableObject.setBySetter(ScriptableObject.java:294) at org.mozilla.javascript.ScriptableObject.put(ScriptableObject.java:256) at com.gargoylesoftware.htmlunit.javascript.SimpleScriptable.put(SimpleScriptable.java:435) at org.mozilla.javascript.ScriptableObject.putProperty(ScriptableObject.java:1476) at org.mozilla.javascript.ScriptRuntime.setProp(ScriptRuntime.java:842) at org.mozilla.javascript.gen.c38.call(Embedded script:241) at org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1191) at org.mozilla.javascript.gen.c43.call(Wrapper definition for onSubmit:1) at org.mozilla.javascript.optimizer.OptRuntime.callSimple(OptRuntime.java:275) at org.mozilla.javascript.gen.c45.call(onSubmit:1) at org.mozilla.javascript.gen.c45.exec(onSubmit) at org.mozilla.javascript.Context.evaluateReader(Context.java:820) at org.mozilla.javascript.Context.evaluateString(Context.java:784) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:256) at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptIfPossible(HtmlPage.java:699) at com.gargoylesoftware.htmlunit.html.HtmlForm.submit(HtmlForm.java:148) at com.gargoylesoftware.htmlunit.html.HtmlSubmitInput.doClickAction(HtmlSubmitInput.java:77) at com.gargoylesoftware.htmlunit.html.ClickableElement.click(ClickableElement.java:107) at com.trilogy.quickstart.htmlunit.test.TestYahooMail.testLogin(TestYahooMail.java:68) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at junit.textui.TestRunner.doRun(TestRunner.java:116) at junit.textui.TestRunner.doRun(TestRunner.java:109) at junit.textui.TestRunner.run(TestRunner.java:72) Can somebody help me out here ? Regards Vinay |
From: Brad C. <yo...@br...> - 2004-10-14 19:31:51
|
Looks like the onsubmit on the form containing the submit input you clicked is setting document.location.href to somewhere that doesn't return a response. I briefly tried to do a yahoo mail login and it wouldn't accept my password for some reason, but I got no exceptions. --- Vinay Murthy <vin...@gm...> wrote: > Hi, > I am new to htmlunit. I was trying to use htmlunit to log into my mail > account, but encountered the following exception trace: > > java.net.ConnectException: Connection timed out: connect ... com.gargoylesoftware.htmlunit.javascript.host.Window.jsSet_location(Window.java:302) ... > com.gargoylesoftware.htmlunit.javascript.host.Location.jsSet_href(Location.java:75) ... com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:256) ... com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptIfPossible(HtmlPage.java:699) ... > at com.gargoylesoftware.htmlunit.html.HtmlForm.submit(HtmlForm.java:148) ... com.gargoylesoftware.htmlunit.html.HtmlSubmitInput.doClickAction(HtmlSubmitInput.java:77) ... com.gargoylesoftware.htmlunit.html.ClickableElement.click(ClickableElement.java:107) ... > com.trilogy.quickstart.htmlunit.test.TestYahooMail.testLogin(TestYahooMail.java:68) ... > Can somebody help me out here ? > > Regards > Vinay > |