You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(6) |
Jul
(17) |
Aug
(18) |
Sep
(22) |
Oct
(16) |
Nov
(6) |
Dec
(11) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(11) |
Feb
(10) |
Mar
(34) |
Apr
(26) |
May
(6) |
Jun
(22) |
Jul
(14) |
Aug
(4) |
Sep
(47) |
Oct
(69) |
Nov
(23) |
Dec
(21) |
2005 |
Jan
(53) |
Feb
(33) |
Mar
(92) |
Apr
(65) |
May
(63) |
Jun
(57) |
Jul
(43) |
Aug
(132) |
Sep
(61) |
Oct
(75) |
Nov
(60) |
Dec
(130) |
2006 |
Jan
(74) |
Feb
(87) |
Mar
(101) |
Apr
(58) |
May
(54) |
Jun
(42) |
Jul
(31) |
Aug
(67) |
Sep
(61) |
Oct
(71) |
Nov
(28) |
Dec
(58) |
2007 |
Jan
(53) |
Feb
(50) |
Mar
(96) |
Apr
(66) |
May
(55) |
Jun
(130) |
Jul
(99) |
Aug
(115) |
Sep
(37) |
Oct
(78) |
Nov
(24) |
Dec
(70) |
2008 |
Jan
(94) |
Feb
(85) |
Mar
(197) |
Apr
(274) |
May
(119) |
Jun
(143) |
Jul
(193) |
Aug
(99) |
Sep
(160) |
Oct
(120) |
Nov
(178) |
Dec
(109) |
2009 |
Jan
(238) |
Feb
(169) |
Mar
(115) |
Apr
(109) |
May
(131) |
Jun
(167) |
Jul
(144) |
Aug
(193) |
Sep
(155) |
Oct
(154) |
Nov
(97) |
Dec
(127) |
2010 |
Jan
(108) |
Feb
(127) |
Mar
(176) |
Apr
(113) |
May
(130) |
Jun
(200) |
Jul
(115) |
Aug
(80) |
Sep
(92) |
Oct
(101) |
Nov
(124) |
Dec
(53) |
2011 |
Jan
(67) |
Feb
(144) |
Mar
(88) |
Apr
(60) |
May
(89) |
Jun
(54) |
Jul
(68) |
Aug
(81) |
Sep
(48) |
Oct
(40) |
Nov
(10) |
Dec
(20) |
2012 |
Jan
(21) |
Feb
(28) |
Mar
(17) |
Apr
(35) |
May
(41) |
Jun
(44) |
Jul
(68) |
Aug
(67) |
Sep
(89) |
Oct
(58) |
Nov
(47) |
Dec
(56) |
2013 |
Jan
(49) |
Feb
(28) |
Mar
(46) |
Apr
(31) |
May
(28) |
Jun
(37) |
Jul
(34) |
Aug
(52) |
Sep
(42) |
Oct
(108) |
Nov
(59) |
Dec
(56) |
2014 |
Jan
(41) |
Feb
(72) |
Mar
(46) |
Apr
(21) |
May
(19) |
Jun
(17) |
Jul
(15) |
Aug
(40) |
Sep
(11) |
Oct
(3) |
Nov
(5) |
Dec
(31) |
2015 |
Jan
(11) |
Feb
(12) |
Mar
(19) |
Apr
(19) |
May
(38) |
Jun
(54) |
Jul
(14) |
Aug
(42) |
Sep
(14) |
Oct
(16) |
Nov
(26) |
Dec
(14) |
2016 |
Jan
(3) |
Feb
(1) |
Mar
(24) |
Apr
(5) |
May
(15) |
Jun
(14) |
Jul
(33) |
Aug
(19) |
Sep
(8) |
Oct
(10) |
Nov
|
Dec
(2) |
2017 |
Jan
(16) |
Feb
(12) |
Mar
(23) |
Apr
(8) |
May
(11) |
Jun
(20) |
Jul
(21) |
Aug
(20) |
Sep
|
Oct
(6) |
Nov
(9) |
Dec
(2) |
2018 |
Jan
(7) |
Feb
(5) |
Mar
(6) |
Apr
(5) |
May
(1) |
Jun
(2) |
Jul
(2) |
Aug
|
Sep
(4) |
Oct
(3) |
Nov
|
Dec
(4) |
2019 |
Jan
(2) |
Feb
(2) |
Mar
(3) |
Apr
(4) |
May
|
Jun
(4) |
Jul
(9) |
Aug
(2) |
Sep
|
Oct
(4) |
Nov
(1) |
Dec
(7) |
2020 |
Jan
(2) |
Feb
(6) |
Mar
(9) |
Apr
(1) |
May
(1) |
Jun
(15) |
Jul
(1) |
Aug
(1) |
Sep
(2) |
Oct
(6) |
Nov
(3) |
Dec
(5) |
2021 |
Jan
(3) |
Feb
(1) |
Mar
(2) |
Apr
(1) |
May
|
Jun
(1) |
Jul
(1) |
Aug
(3) |
Sep
(1) |
Oct
|
Nov
(1) |
Dec
|
2022 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
(1) |
Jul
(4) |
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(6) |
2025 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Guillaume L. <gui...@gm...> - 2005-07-20 13:07:11
|
As usual, I forgot to enclose the .java file ... package ch.tecost.siems.usecase.resident.care.dma.assistant; import java.net.MalformedURLException; import java.net.URL; import junit.framework.TestCase; import org.apache.log4j.Logger; import com.gargoylesoftware.htmlunit.WebClient; import com.gargoylesoftware.htmlunit.html.HtmlForm; import com.gargoylesoftware.htmlunit.html.HtmlPage; public class XNIExceptionHttpTest extends TestCase { private static final Logger logger =3D Logger =20 .getLogger(XNIExceptionHttpTest.class); private static final String BASE_TEST_URL =3D "http://www.google.ch"; private static final String SEARCH_FORM =3D "f"; =20 public static URL getUrl(String url) throws MalformedURLException { return new URL(BASE_TEST_URL + url); } private static final String TEST_PAGE =3D "/"; @Override public void setUp() throws Exception { super.setUp(); } public void testDmaAssistant() throws Exception { try { WebClient client =3D new WebClient(); HtmlPage page =3D getPage(client); validatePage(page); } catch (Throwable t) { logger.error("Uncatched Exception", t); } } public static HtmlPage getPage(WebClient client) throws Exception { URL url =3D getUrl(TEST_PAGE); logger.debug("Getting page : "); logger.debug(url); return (HtmlPage) client.getPage(url); } private static HtmlForm getForm(HtmlPage page) { return page.getFormByName(SEARCH_FORM); } private static void validatePage(HtmlPage page) throws Exception { logger.debug("Validating the page"); HtmlForm form =3D getForm(page); assertNotNull("Prescription form was not found !", form); } } |
From: Guillaume L. <gui...@gm...> - 2005-07-20 13:06:41
|
On 7/20/05, Marc Guillemot <mgu...@ya...> wrote: > Salut Guillaume, Mais Bonjour tr=E8s cher Marc ! > never seen that before (I use Eclipse all the time). Is it the full stack= trace? Can you produce a minimal test > illustrating the problem? I enclose a very simple test that shows the same behaviour while checking "Google". Again, this test runs fine in Eclipse but doesnt runs from Maven. I send only the .java file for now. If you need, I can assemble a simple Maven project that shows the same failure. Can I send attachements to the list or should I post an http link to the Maven project ? Thanks a lot for the fast reply ! Guillaume |
From: Marc G. <mgu...@ya...> - 2005-07-20 12:38:53
|
Salut Guillaume, never seen that before (I use Eclipse all the time). Is it the full stack trace? Can you produce a minimal test illustrating the problem? Marc. Guillaume Lederrey wrote: > Hello ! > > I hit a strange problem (stack trace below). I get an XNIException > when running my tests from Maven. The same tests (same code, same > jars, ...) runs fine when run from Eclipse. > > I found some stuff on the net about JavaScript problems, and it > seems related. When I deactivate JS with > "client.setJavaScriptEnabled(false);" my test runs fine both in > eclipse and in maven. I tried to enable logging by adding > "log4j.logger.com.gargoylesoftware.htmlunit.javascript=DEBUG" to my > log4j.properties but with no success (no log related to that error). > > It really bothers me that the tests run only in Eclipse. I suppose > the problem comes from some Maven config I forgot, but i really cant > see where. Any help appreciated ! > > Thanks a lot, > > Guillaume > > > Stack trace : > > 2005-07-20 13:23:15,940 [main] ERROR > ch.tecost.siems.usecase.resident.care.dma.a > ssistant.DmaAssistantHttpTest - Uncatched Exception > org.apache.xerces.xni.XNIException > at org.cyberneko.html.HTMLScanner$ContentScanner.scan(HTMLScanner.java:1 > 860) > at org.cyberneko.html.HTMLScanner.scanDocument(HTMLScanner.java:789) > at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:478 > ) > at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:431 > ) > at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) > at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.pars > e(HTMLParser.java:330) > at com.gargoylesoftware.htmlunit.html.HTMLParser.parse(HTMLParser.java:2 > 45) > at com.gargoylesoftware.htmlunit.DefaultPageCreator.createHtmlPage(Defau > ltPageCreator.java:115) > at com.gargoylesoftware.htmlunit.DefaultPageCreator.createPage(DefaultPa > geCreator.java:84) > at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient > .java:709) > at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:376) > at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:415) > at ch.tecost.siems.usecase.resident.care.dma.assistant.DmaAssistantHttpT > est.getPage(DmaAssistantHttpTest.java:58) > at ch.tecost.siems.usecase.resident.care.dma.assistant.DmaAssistantHttpT > est.testDmaAssistant(DmaAssistantHttpTest.java:50) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. > java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces > sorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > 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 org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUni > tTestRunner.java:325) > at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.executeInVM(JU > nitTask.java:848) > at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute(JUnitT > ask.java:556) > at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute(JUnitT > ask.java:532) > at org.apache.tools.ant.Task.perform(Task.java:341) > at org.apache.commons.jelly.tags.ant.AntTag.doTag(AntTag.java:185) > at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279) > at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135) > at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:233) > at org.apache.commons.jelly.tags.core.IfTag.doTag(IfTag.java:88) > at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279) > at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135) > at org.apache.maven.jelly.tags.werkz.MavenGoalTag.runBodyTag(MavenGoalTa > g.java:79) > at org.apache.maven.jelly.tags.werkz.MavenGoalTag$MavenGoalAction.perfor > mAction(MavenGoalTag.java:110) > at com.werken.werkz.Goal.fire(Goal.java:639) > at com.werken.werkz.Goal.attain(Goal.java:575) > at com.werken.werkz.Goal.attainPrecursors(Goal.java:488) > at com.werken.werkz.Goal.attain(Goal.java:573) > at org.apache.maven.plugin.PluginManager.attainGoals(PluginManager.java: > 671) > at org.apache.maven.MavenSession.attainGoals(MavenSession.java:263) > at org.apache.maven.cli.App.doMain(App.java:488) > at org.apache.maven.cli.App.main(App.java:1239) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. > java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces > sorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at com.werken.forehead.Forehead.run(Forehead.java:551) > at com.werken.forehead.Forehead.main(Forehead.java:581) > > > ------------------------------------------------------- > SF.Net email is sponsored by: Discover Easy Linux Migration Strategies > from IBM. Find simple to follow Roadmaps, straightforward articles, > informative Webcasts and more! Get everything you need to get up to > speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > |
From: Marc G. <mgu...@ya...> - 2005-07-20 12:34:17
|
It seems that you hit javascript code that is invalid or more likely that htmlunit doesn't currently understand. You have to look at your principal.js file on which object the method "botoes_esconderNavegacao" is called and see why htmlunit doesn't see this object as defined. If you can find the origin of the problem and produce a minimal example, you can open a bug issue (of course, the best is with unit test). Alternatively, if you don't need to test the js features of your app, you can deactivate javascript. Marc. Rogério Nibon wrote: > Hello! > > I'm starting to use HtmlUnit. I got Htmlunit 1.6 runnig in Eclipse > and made a test case. It loads a login page for the web application > and logs in. After logging in, the main page of the application is > loaded, and it contains JavaScript. HtmlUnit produces the StackTrace > below. Could anybody help me? > > Thanks in advice! > Rogério Nibon. > > ======= EXCEPTION START ======== > EcmaError: lineNumber=[2] column=[0] lineSource=[ [native code, > arity=0]] name=[TypeError] sourceName=[js/geral/principal.js] > message=[TypeError: Cannot call method "botoes_esconderNavegacao" of > undefined (js/geral/principal.js#2)] > com.gargoylesoftware.htmlunit.ScriptException: TypeError: Cannot call > method "botoes_esconderNavegacao" of undefined > (js/geral/principal.js#2) > at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:340) > at com.gargoylesoftware.htmlunit.html.HtmlPage.executeOnLoadHandlersIfNeeded(HtmlPage.java:963) > at com.gargoylesoftware.htmlunit.html.HtmlPage.initialize(HtmlPage.java:158) > at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:716) > at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:376) > at com.gargoylesoftware.htmlunit.html.BaseFrame.loadInnerPageIfPossible(BaseFrame.java:212) > at com.gargoylesoftware.htmlunit.html.BaseFrame.loadInnerPage(BaseFrame.java:198) > at com.gargoylesoftware.htmlunit.html.HtmlPage.notifyNodeAdded(HtmlPage.java:1396) > at com.gargoylesoftware.htmlunit.html.DomNode.appendChild(DomNode.java:463) > at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.startElement(HTMLParser.java:368) > at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source) > at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown > Source) > at org.cyberneko.html.filters.DefaultFilter.emptyElement(DefaultFilter.java:187) > at org.cyberneko.html.filters.NamespaceBinder.emptyElement(NamespaceBinder.java:319) > at org.cyberneko.html.HTMLTagBalancer.startElement(HTMLTagBalancer.java:629) > at org.cyberneko.html.HTMLScanner$ContentScanner.scanStartElement(HTMLScanner.java:2343) > at org.cyberneko.html.HTMLScanner$ContentScanner.scan(HTMLScanner.java:1820) > at org.cyberneko.html.HTMLScanner.scanDocument(HTMLScanner.java:789) > at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:478) > at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:431) > at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) > at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.parse(HTMLParser.java:330) > at com.gargoylesoftware.htmlunit.html.HTMLParser.parse(HTMLParser.java:245) > at com.gargoylesoftware.htmlunit.DefaultPageCreator.createHtmlPage(DefaultPageCreator.java:115) > at com.gargoylesoftware.htmlunit.DefaultPageCreator.createPage(DefaultPageCreator.java:84) > at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:709) > at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:376) > at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:402) > at com.gargoylesoftware.htmlunit.html.HtmlForm.submit(HtmlForm.java:216) > at com.gargoylesoftware.htmlunit.html.HtmlSubmitInput.doClickAction(HtmlSubmitInput.java:77) > at com.gargoylesoftware.htmlunit.html.ClickableElement.click(ClickableElement.java:120) > at br.gov.agu.sicor.geral.util.SicorTest.testHomePage(SicorTest.java:38) > 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 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) > Enclosed exception: > org.mozilla.javascript.EcmaError: TypeError: Cannot call method > "botoes_esconderNavegacao" of undefined (js/geral/principal.js#2) > at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3240) > at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3230) > at org.mozilla.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3246) > at org.mozilla.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:3265) > at org.mozilla.javascript.ScriptRuntime.undefCallError(ScriptRuntime.java:3284) > at org.mozilla.javascript.ScriptRuntime.getPropFunctionAndThis(ScriptRuntime.java:1965) > at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2869) > at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2164) > at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:140) > at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:304) > at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:2769) > at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2145) > at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:140) > at com.gargoylesoftware.htmlunit.javascript.host.EventHandler.call(EventHandler.java:88) > at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:335) > at com.gargoylesoftware.htmlunit.html.HtmlPage.executeOnLoadHandlersIfNeeded(HtmlPage.java:963) > at com.gargoylesoftware.htmlunit.html.HtmlPage.initialize(HtmlPage.java:158) > at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:716) > at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:376) > at com.gargoylesoftware.htmlunit.html.BaseFrame.loadInnerPageIfPossible(BaseFrame.java:212) > at com.gargoylesoftware.htmlunit.html.BaseFrame.loadInnerPage(BaseFrame.java:198) > at com.gargoylesoftware.htmlunit.html.HtmlPage.notifyNodeAdded(HtmlPage.java:1396) > at com.gargoylesoftware.htmlunit.html.DomNode.appendChild(DomNode.java:463) > at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.startElement(HTMLParser.java:368) > at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source) > at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown > Source) > at org.cyberneko.html.filters.DefaultFilter.emptyElement(DefaultFilter.java:187) > at org.cyberneko.html.filters.NamespaceBinder.emptyElement(NamespaceBinder.java:319) > at org.cyberneko.html.HTMLTagBalancer.startElement(HTMLTagBalancer.java:629) > at org.cyberneko.html.HTMLScanner$ContentScanner.scanStartElement(HTMLScanner.java:2343) > at org.cyberneko.html.HTMLScanner$ContentScanner.scan(HTMLScanner.java:1820) > at org.cyberneko.html.HTMLScanner.scanDocument(HTMLScanner.java:789) > at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:478) > at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:431) > at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) > at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.parse(HTMLParser.java:330) > at com.gargoylesoftware.htmlunit.html.HTMLParser.parse(HTMLParser.java:245) > at com.gargoylesoftware.htmlunit.DefaultPageCreator.createHtmlPage(DefaultPageCreator.java:115) > at com.gargoylesoftware.htmlunit.DefaultPageCreator.createPage(DefaultPageCreator.java:84) > at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:709) > at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:376) > at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:402) > at com.gargoylesoftware.htmlunit.html.HtmlForm.submit(HtmlForm.java:216) > at com.gargoylesoftware.htmlunit.html.HtmlSubmitInput.doClickAction(HtmlSubmitInput.java:77) > at com.gargoylesoftware.htmlunit.html.ClickableElement.click(ClickableElement.java:120) > at br.gov.agu.sicor.geral.util.SicorTest.testHomePage(SicorTest.java:38) > 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 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) > == CALLING JAVASCRIPT == > function () { > [native code, arity=0] > } > > ======= EXCEPTION END ======== > > > ------------------------------------------------------- > SF.Net email is sponsored by: Discover Easy Linux Migration Strategies > from IBM. Find simple to follow Roadmaps, straightforward articles, > informative Webcasts and more! Get everything you need to get up to > speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > |
From: <rog...@gm...> - 2005-07-20 12:26:09
|
Hello! I'm starting to use HtmlUnit. I got Htmlunit 1.6 runnig in Eclipse and made a test case. It loads a login page for the web application and logs in. After logging in, the main page of the application is loaded, and it contains JavaScript. HtmlUnit produces the StackTrace below. Could anybody help me? Thanks in advice! Rog=E9rio Nibon. =3D=3D=3D=3D=3D=3D=3D EXCEPTION START =3D=3D=3D=3D=3D=3D=3D=3D EcmaError: lineNumber=3D[2] column=3D[0] lineSource=3D[=09[native code, arity=3D0]] name=3D[TypeError] sourceName=3D[js/geral/principal.js] message=3D[TypeError: Cannot call method "botoes_esconderNavegacao" of undefined (js/geral/principal.js#2)] com.gargoylesoftware.htmlunit.ScriptException: TypeError: Cannot call method "botoes_esconderNavegacao" of undefined (js/geral/principal.js#2) =09at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunctio= n(JavaScriptEngine.java:340) =09at com.gargoylesoftware.htmlunit.html.HtmlPage.executeOnLoadHandlersIfNe= eded(HtmlPage.java:963) =09at com.gargoylesoftware.htmlunit.html.HtmlPage.initialize(HtmlPage.java:= 158) =09at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient= .java:716) =09at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:376) =09at com.gargoylesoftware.htmlunit.html.BaseFrame.loadInnerPageIfPossible(= BaseFrame.java:212) =09at com.gargoylesoftware.htmlunit.html.BaseFrame.loadInnerPage(BaseFrame.= java:198) =09at com.gargoylesoftware.htmlunit.html.HtmlPage.notifyNodeAdded(HtmlPage.= java:1396) =09at com.gargoylesoftware.htmlunit.html.DomNode.appendChild(DomNode.java:4= 63) =09at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.star= tElement(HTMLParser.java:368) =09at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Sour= ce) =09at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unkn= own Source) =09at org.cyberneko.html.filters.DefaultFilter.emptyElement(DefaultFilter.j= ava:187) =09at org.cyberneko.html.filters.NamespaceBinder.emptyElement(NamespaceBind= er.java:319) =09at org.cyberneko.html.HTMLTagBalancer.startElement(HTMLTagBalancer.java:= 629) =09at org.cyberneko.html.HTMLScanner$ContentScanner.scanStartElement(HTMLSc= anner.java:2343) =09at org.cyberneko.html.HTMLScanner$ContentScanner.scan(HTMLScanner.java:1= 820) =09at org.cyberneko.html.HTMLScanner.scanDocument(HTMLScanner.java:789) =09at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:478= ) =09at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:431= ) =09at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) =09at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.pars= e(HTMLParser.java:330) =09at com.gargoylesoftware.htmlunit.html.HTMLParser.parse(HTMLParser.java:2= 45) =09at com.gargoylesoftware.htmlunit.DefaultPageCreator.createHtmlPage(Defau= ltPageCreator.java:115) =09at com.gargoylesoftware.htmlunit.DefaultPageCreator.createPage(DefaultPa= geCreator.java:84) =09at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient= .java:709) =09at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:376) =09at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:402) =09at com.gargoylesoftware.htmlunit.html.HtmlForm.submit(HtmlForm.java:216) =09at com.gargoylesoftware.htmlunit.html.HtmlSubmitInput.doClickAction(Html= SubmitInput.java:77) =09at com.gargoylesoftware.htmlunit.html.ClickableElement.click(ClickableEl= ement.java:120) =09at br.gov.agu.sicor.geral.util.SicorTest.testHomePage(SicorTest.java:38) =09at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) =09at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) =09at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) =09at java.lang.reflect.Method.invoke(Unknown Source) =09at junit.framework.TestCase.runTest(TestCase.java:154) =09at junit.framework.TestCase.runBare(TestCase.java:127) =09at junit.framework.TestResult$1.protect(TestResult.java:106) =09at junit.framework.TestResult.runProtected(TestResult.java:124) =09at junit.framework.TestResult.run(TestResult.java:109) =09at junit.framework.TestCase.run(TestCase.java:118) =09at junit.framework.TestSuite.runTest(TestSuite.java:208) =09at junit.framework.TestSuite.run(TestSuite.java:203) =09at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(Remot= eTestRunner.java:478) =09at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTest= Runner.java:344) =09at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTes= tRunner.java:196) Enclosed exception:=20 org.mozilla.javascript.EcmaError: TypeError: Cannot call method "botoes_esconderNavegacao" of undefined (js/geral/principal.js#2) =09at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.jav= a:3240) =09at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.jav= a:3230) =09at org.mozilla.javascript.ScriptRuntime.typeError(ScriptRuntime.java:324= 6) =09at org.mozilla.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:32= 65) =09at org.mozilla.javascript.ScriptRuntime.undefCallError(ScriptRuntime.jav= a:3284) =09at org.mozilla.javascript.ScriptRuntime.getPropFunctionAndThis(ScriptRun= time.java:1965) =09at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2869) =09at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2164) =09at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.j= ava:140) =09at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:3= 04) =09at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:276= 9) =09at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2145) =09at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.j= ava:140) =09at com.gargoylesoftware.htmlunit.javascript.host.EventHandler.call(Event= Handler.java:88) =09at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunctio= n(JavaScriptEngine.java:335) =09at com.gargoylesoftware.htmlunit.html.HtmlPage.executeOnLoadHandlersIfNe= eded(HtmlPage.java:963) =09at com.gargoylesoftware.htmlunit.html.HtmlPage.initialize(HtmlPage.java:= 158) =09at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient= .java:716) =09at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:376) =09at com.gargoylesoftware.htmlunit.html.BaseFrame.loadInnerPageIfPossible(= BaseFrame.java:212) =09at com.gargoylesoftware.htmlunit.html.BaseFrame.loadInnerPage(BaseFrame.= java:198) =09at com.gargoylesoftware.htmlunit.html.HtmlPage.notifyNodeAdded(HtmlPage.= java:1396) =09at com.gargoylesoftware.htmlunit.html.DomNode.appendChild(DomNode.java:4= 63) =09at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.star= tElement(HTMLParser.java:368) =09at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Sour= ce) =09at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unkn= own Source) =09at org.cyberneko.html.filters.DefaultFilter.emptyElement(DefaultFilter.j= ava:187) =09at org.cyberneko.html.filters.NamespaceBinder.emptyElement(NamespaceBind= er.java:319) =09at org.cyberneko.html.HTMLTagBalancer.startElement(HTMLTagBalancer.java:= 629) =09at org.cyberneko.html.HTMLScanner$ContentScanner.scanStartElement(HTMLSc= anner.java:2343) =09at org.cyberneko.html.HTMLScanner$ContentScanner.scan(HTMLScanner.java:1= 820) =09at org.cyberneko.html.HTMLScanner.scanDocument(HTMLScanner.java:789) =09at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:478= ) =09at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:431= ) =09at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) =09at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.pars= e(HTMLParser.java:330) =09at com.gargoylesoftware.htmlunit.html.HTMLParser.parse(HTMLParser.java:2= 45) =09at com.gargoylesoftware.htmlunit.DefaultPageCreator.createHtmlPage(Defau= ltPageCreator.java:115) =09at com.gargoylesoftware.htmlunit.DefaultPageCreator.createPage(DefaultPa= geCreator.java:84) =09at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient= .java:709) =09at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:376) =09at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:402) =09at com.gargoylesoftware.htmlunit.html.HtmlForm.submit(HtmlForm.java:216) =09at com.gargoylesoftware.htmlunit.html.HtmlSubmitInput.doClickAction(Html= SubmitInput.java:77) =09at com.gargoylesoftware.htmlunit.html.ClickableElement.click(ClickableEl= ement.java:120) =09at br.gov.agu.sicor.geral.util.SicorTest.testHomePage(SicorTest.java:38) =09at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) =09at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) =09at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) =09at java.lang.reflect.Method.invoke(Unknown Source) =09at junit.framework.TestCase.runTest(TestCase.java:154) =09at junit.framework.TestCase.runBare(TestCase.java:127) =09at junit.framework.TestResult$1.protect(TestResult.java:106) =09at junit.framework.TestResult.runProtected(TestResult.java:124) =09at junit.framework.TestResult.run(TestResult.java:109) =09at junit.framework.TestCase.run(TestCase.java:118) =09at junit.framework.TestSuite.runTest(TestSuite.java:208) =09at junit.framework.TestSuite.run(TestSuite.java:203) =09at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(Remot= eTestRunner.java:478) =09at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTest= Runner.java:344) =09at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTes= tRunner.java:196) =3D=3D CALLING JAVASCRIPT =3D=3D function () { =09[native code, arity=3D0] } =3D=3D=3D=3D=3D=3D=3D EXCEPTION END =3D=3D=3D=3D=3D=3D=3D=3D |
From: Guillaume L. <gui...@gm...> - 2005-07-20 11:25:08
|
Hello ! I hit a strange problem (stack trace below). I get an XNIException when running my tests from Maven. The same tests (same code, same jars, ...) runs fine when run from Eclipse. I found some stuff on the net about JavaScript problems, and it seems related. When I deactivate JS with "client.setJavaScriptEnabled(false);" my test runs fine both in eclipse and in maven. I tried to enable logging by adding "log4j.logger.com.gargoylesoftware.htmlunit.javascript=3DDEBUG" to my log4j.properties but with no success (no log related to that error). It really bothers me that the tests run only in Eclipse. I suppose the problem comes from some Maven config I forgot, but i really cant see where. Any help appreciated ! Thanks a lot, Guillaume Stack trace : 2005-07-20 13:23:15,940 [main] ERROR ch.tecost.siems.usecase.resident.care.dma.a ssistant.DmaAssistantHttpTest - Uncatched Exception org.apache.xerces.xni.XNIException at org.cyberneko.html.HTMLScanner$ContentScanner.scan(HTMLScanner.j= ava:1 860) at org.cyberneko.html.HTMLScanner.scanDocument(HTMLScanner.java:789= ) at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.jav= a:478 ) at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.jav= a:431 ) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder= .pars e(HTMLParser.java:330) at com.gargoylesoftware.htmlunit.html.HTMLParser.parse(HTMLParser.j= ava:2 45) at com.gargoylesoftware.htmlunit.DefaultPageCreator.createHtmlPage(= Defau ltPageCreator.java:115) at com.gargoylesoftware.htmlunit.DefaultPageCreator.createPage(Defa= ultPa geCreator.java:84) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebC= lient .java:709) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:3= 76) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:4= 15) at ch.tecost.siems.usecase.resident.care.dma.assistant.DmaAssistant= HttpT est.getPage(DmaAssistantHttpTest.java:58) at ch.tecost.siems.usecase.resident.care.dma.assistant.DmaAssistant= HttpT est.testDmaAssistant(DmaAssistantHttpTest.java:50) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessor= Impl. java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethod= Acces sorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) 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 org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run= (JUni tTestRunner.java:325) at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.executeIn= VM(JU nitTask.java:848) at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute(J= UnitT ask.java:556) at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute(J= UnitT ask.java:532) at org.apache.tools.ant.Task.perform(Task.java:341) at org.apache.commons.jelly.tags.ant.AntTag.doTag(AntTag.java:185) at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:1= 35) at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:2= 33) at org.apache.commons.jelly.tags.core.IfTag.doTag(IfTag.java:88) at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:1= 35) at org.apache.maven.jelly.tags.werkz.MavenGoalTag.runBodyTag(MavenG= oalTa g.java:79) at org.apache.maven.jelly.tags.werkz.MavenGoalTag$MavenGoalAction.p= erfor mAction(MavenGoalTag.java:110) at com.werken.werkz.Goal.fire(Goal.java:639) at com.werken.werkz.Goal.attain(Goal.java:575) at com.werken.werkz.Goal.attainPrecursors(Goal.java:488) at com.werken.werkz.Goal.attain(Goal.java:573) at org.apache.maven.plugin.PluginManager.attainGoals(PluginManager.= java: 671) at org.apache.maven.MavenSession.attainGoals(MavenSession.java:263) at org.apache.maven.cli.App.doMain(App.java:488) at org.apache.maven.cli.App.main(App.java:1239) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessor= Impl. java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethod= Acces sorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at com.werken.forehead.Forehead.run(Forehead.java:551) at com.werken.forehead.Forehead.main(Forehead.java:581) |
From: Karl <ka...@we...> - 2005-07-19 00:13:13
|
Hi everyone. I've recently built a web navigation tool that sits on top of htmlunit to make the dom navigation a bit easier. With it you can chain navigations together to get to the element you are looking for quickly, or to check if something exists. For example: WebNavigator nav = new WebNavigator(); nav.gotoUrl(someUrl); // do a deep search from the body's child elements onward, for an // element that has id "randomLink" and attempt to activate it. // This assumes that the element can be activated (i.e. an anchor or // button). nav.bodyChildren().deep().id("randomLink").activate(); Another navigation: // Get the div elements that are directly below the body tag, find the // one with id "section1", get the form elements from its children, // find the one that has id "formA", then get the first input element // underneath it and set it to "10". nav.bodyChildren().div().id("section1").children().form().id("formA").children().input().setValue(10); Using regular expressions: // Do a deep search for any element on the page that is an anchor, // then narrow down the search to an anchor that has viewable text // containing "random" at any point, and tell me if it exists nav.page().deep().a().pattern().text(".*random.*").exists(); Anyway I've set up a sourceforge project for it at http://navigation.sourceforge.net Have a look if you think it might be useful. |
From: Marc G. <mgu...@ya...> - 2005-07-15 15:50:30
|
Hi, for a few monthes, htmlunit worked on ebay with a small adaptation to cope with incorrect html (tags like <head3> found in <head>). Now the ebay's generated html seems to be correct but htmlunit fails executing the js. If you don't *really* have to, I would recommend to you not to investigate on it: ebay's javascript is probably the most awfull js code I've had to work on when making htmlunit work for it for some monthes. Marc. David D. Kilzer wrote: > It's probably a missing (or misimplemented) JavaScript feature in > Htmlunit. Have you tried using a different browser type by passing in > a constant to the WebClient constructor to make it look like a > different browser? The default is MSIE 6, I believe. Try the Mozilla > 1.0 browser to see if it behaves differently. For example, Google's > home page returns different JavaScript depending on the browser type. > > Htmlunit has a "sanity test" as part of its unit tests that hits the > home pages of a variety of external web sites. I would recommend > filing a bug on SourceForge about this since it seems to be another > good external web site to hit. > > Dave > > > On Jul 11, 2005, at 1:02 AM, John Smith wrote: > >> I don't have a specific question per se. However, I am concerned >> about HTMLUnit's behavior when I attempt to access ebay.com: >> >> Code >> ------------------ >> import java.net.URL; >> import com.gargoylesoftware.htmlunit.WebClient; >> import com.gargoylesoftware.htmlunit.html.HtmlPage; >> >> public class Test { >> >> public static void main( String[] args ) { >> >> try { >> >> WebClient webClient = new WebClient(); >> webClient.setRedirectEnabled( true ); >> >> HtmlPage page = ( HtmlPage ) webClient.getPage( new URL( >> "http://www.ebay.com" ) ); >> >> if ( page != null ) { >> >> System.out.println( page.asXml() ); >> } >> >> } catch ( Exception e ) { >> >> System.err.println( "Exception: " + e.getMessage() ); >> e.printStackTrace(); >> } >> } >> } >> >> Output >> ------------------ >> >>> java Test >>> >> Jul 11, 2005 1:51:59 AM >> com.gargoylesoftware.htmlunit.javascript.host.Document jsxSet_cookie >> INFO: Added cookie: ebay=%5Edv%3D42d208ff%5E >> Jul 11, 2005 1:52:00 AM >> com.gargoylesoftware.htmlunit.javascript.host.Document jsxSet_cookie >> INFO: Added cookie: ebay=%5Edv%3D42d20900%5E >> Jul 11, 2005 1:52:04 AM >> com.gargoylesoftware.htmlunit.javascript.host.Document jsxSet_cookie >> INFO: Added cookie: lucky9=626637 >> Exception in thread "main" java.lang.StackOverflowError >> at java.net.URLStreamHandler.parseURL(Unknown Source) >> at sun.net.www.protocol.file.Handler.parseURL(Unknown Source) >> at java.net.URL.<init>(Unknown Source) >> at java.net.URL.<init>(Unknown Source) >> at sun.misc.URLClassPath$FileLoader.getResource(Unknown Source) >> at sun.misc.URLClassPath$FileLoader.findResource(Unknown Source) >> at sun.misc.URLClassPath.findResource(Unknown Source) >> at java.net.URLClassLoader$2.run(Unknown Source) >> at java.security.AccessController.doPrivileged(Native Method) >> at java.net.URLClassLoader.findResource(Unknown Source) >> at java.lang.ClassLoader.getResource(Unknown Source) >> at java.lang.ClassLoader.getResourceAsStream(Unknown Source) >> at java.util.ResourceBundle$1.run(Unknown Source) >> at java.security.AccessController.doPrivileged(Native Method) >> at java.util.ResourceBundle.loadBundle(Unknown Source) >> at java.util.ResourceBundle.findBundle(Unknown Source) >> at java.util.ResourceBundle.getBundleImpl(Unknown Source) >> at java.util.ResourceBundle.getBundle(Unknown Source) >> at java.util.logging.Level.getLocalizedName(Unknown Source) >> at java.util.logging.SimpleFormatter.format(Unknown Source) >> at java.util.logging.StreamHandler.publish(Unknown Source) >> at java.util.logging.ConsoleHandler.publish(Unknown Source) >> at java.util.logging.Logger.log(Unknown Source) >> at java.util.logging.Logger.doLog(Unknown Source) >> at java.util.logging.Logger.logp(Unknown Source) >> at org.apache.commons.logging.impl.Jdk14Logger.log >> (Jdk14Logger.java:91) >> at org.apache.commons.logging.impl.Jdk14Logger.error >> (Jdk14Logger.java:119) >> at >> com.gargoylesoftware.htmlunit.javascript.StrictErrorReporter.runtimeEr >> ror(StrictErrorReporter.java:113) >> at org.mozilla.javascript.Context.reportRuntimeError >> (Context.java:1054) >> at org.mozilla.javascript.Parser.parse(Parser.java:354) >> at org.mozilla.javascript.Parser.parse(Parser.java:287) >> at org.mozilla.javascript.Context.compileImpl(Context.java: 2349) >> at org.mozilla.javascript.Context.compileString >> (Context.java:1372) >> at org.mozilla.javascript.ScriptRuntime.evalSpecial >> (ScriptRuntime.java:2202) >> at org.mozilla.javascript.ScriptRuntime.callSpecial >> (ScriptRuntime.java:2071) >> at org.mozilla.javascript.Interpreter.interpret >> (Interpreter.java:2922) >> at org.mozilla.javascript.Interpreter.interpret >> (Interpreter.java:2164) >> at org.mozilla.javascript.InterpretedFunction.call >> (InterpretedFunction.java:140) >> at org.mozilla.javascript.ScriptRuntime.evalSpecial >> (ScriptRuntime.java:2217) >> at org.mozilla.javascript.ScriptRuntime.callSpecial >> (ScriptRuntime.java:2071) >> at org.mozilla.javascript.Interpreter.interpret >> (Interpreter.java:2922) >> at org.mozilla.javascript.Interpreter.interpret >> (Interpreter.java:2164) >> at org.mozilla.javascript.InterpretedFunction.call >> (InterpretedFunction.java:140) >> at org.mozilla.javascript.ScriptRuntime.evalSpecial >> (ScriptRuntime.java:2217) >> at org.mozilla.javascript.ScriptRuntime.callSpecial >> (ScriptRuntime.java:2071) >> at org.mozilla.javascript.Interpreter.interpret >> (Interpreter.java:2922) >> at org.mozilla.javascript.Interpreter.interpret >> (Interpreter.java:2164) >> at org.mozilla.javascript.InterpretedFunction.call >> (InterpretedFunction.java:140) >> at org.mozilla.javascript.ScriptRuntime.evalSpecial >> (ScriptRuntime.java:2217) >> at org.mozilla.javascript.ScriptRuntime.callSpecial >> (ScriptRuntime.java:2071) >> at org.mozilla.javascript.Interpreter.interpret >> (Interpreter.java:2922) >> at org.mozilla.javascript.Interpreter.interpret >> (Interpreter.java:2164) >> at org.mozilla.javascript.InterpretedFunction.call >> (InterpretedFunction.java:140) >> at org.mozilla.javascript.ScriptRuntime.evalSpecial >> (ScriptRuntime.java:2217) >> at org.mozilla.javascript.ScriptRuntime.callSpecial >> (ScriptRuntime.java:2071) >> at org.mozilla.javascript.Interpreter.interpret >> (Interpreter.java:2922) >> at org.mozilla.javascript.Interpreter.interpret >> (Interpreter.java:2164) >> at org.mozilla.javascript.InterpretedFunction.call >> (InterpretedFunction.java:140) >> at org.mozilla.javascript.ScriptRuntime.evalSpecial >> (ScriptRuntime.java:2217) >> at org.mozilla.javascript.ScriptRuntime.callSpecial >> (ScriptRuntime.java:2071) >> at org.mozilla.javascript.Interpreter.interpret >> (Interpreter.java:2922) >> at org.mozilla.javascript.Interpreter.interpret >> (Interpreter.java:2164) >> at org.mozilla.javascript.InterpretedFunction.call >> (InterpretedFunction.java:140) >> at org.mozilla.javascript.ScriptRuntime.evalSpecial >> (ScriptRuntime.java:2217) >> ... >> >> * Note: The last five stack trace lines keep repeating (hence the ...) >> >> Does anyone have any suggestions or explanations? Thanks. >> > > > ------------------------------------------------------- > SF.Net email is sponsored by: Discover Easy Linux Migration Strategies > from IBM. Find simple to follow Roadmaps, straightforward articles, > informative Webcasts and more! Get everything you need to get up to > speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > |
From: David D. K. <ddk...@ki...> - 2005-07-15 15:03:17
|
It would appear that there are some JavaScript functions/features =20 that are enabled for Mozilla but aren't enabled for MSIE. OR your =20 JavaScript has two different execution paths (one for Mozilla, one =20 for MSIE), and all the functions/features are present for the Mozilla =20= path, but not for the MSIE path. I would recommend filing a bug on SourceForge, and writing a reduced =20 test case for the problem. Posting the JavaScript here would also =20 help in diagnosing the issue. Dave On Jul 7, 2005, at 9:07 AM, Zbigniew Kominek wrote: > I'have a little problem :) > Part of my web page is written in JavaScript. There are implemented > couple methods. One of those look as follows: > > function getWidth() { > var width=3Dwindow.innerWidth; > if (width=3D=3Dnull) > width=3Ddocument.body.offsetWidth; > return w; > } > > When I try to test that page using settings for Mozilla: > > final WebClient webClient =3D new = WebClient(BrowserVersion.MOZILLA_1_0); > > everythigs worked ok, the property window.innerWidth returned proper > value of window width, but problem arrived when I switched > configuration to: > > final WebClient webClient =3D new > WebClient(BrowserVersion.INTERNET_EXPLORER_6_0); > > Now document.body.offsetWidth returns nothing. I tried to add > another property in JavaScriptConfiguration.xml file: > > <property name=3D"clientWidth" readable=3D"true" writable=3D"false"/> > <property name=3D"clientHeight" readable=3D"true" writable=3D"false"/> > > and I change offsetWidth to clientWidth in getWidth function, but > this solution doesn't solve the problem. Is there some possibility > to get size of the document (or window) in such a way, that hmtlunit > works with it ok in both (Mozilla and IE) situations? Or maybe > htmlunit can be configured in some other way? > > Best regards > Zbyhoo > > ---------------------------------------------------- > Zadbaj o bezpieczne wakacje nad wod=C4=85! > W=C5=82=C4=85cz si=C4=99 w Bezpieczne lato z NIVEA i WOPR > http://klik.wp.pl/?adr=3Dwww.sport.wp.pl%2Fnivea-wopr.html&sid=3D427 |
From: David D. K. <ddk...@ki...> - 2005-07-15 15:00:27
|
If you want to call executeJavaScriptFunctionIfPossible() if possible yourself, I would recommend downloading the Htmlunit source code and studying it. However, I'm certain that calling executeJavaScriptFunctionIfPossible() is not supported. Instead I would recommend adding a button to the web page at run-time (see the AddFormField example on the wiki) with an "onclick" event set to call your JavaScript function. Then simply click the button to call the JavaScript function. http://htmlunit.sourceforge.net/phpwiki/index.php/AddFormField Dave On Jul 7, 2005, at 2:40 AM, Thomas Pich wrote: > Hi, > > could anybody give me an example, how can I invoke a Javascript- > Function > with Htmlunit? Perhaps like this: > > <script type="text/javascript"> > function FunctionXYZ () { > ... > } > </script> > > final WebClient webClient = new WebClient(); > final URL url = new URL( "http://y.x.z/test.html" ); > final HtmlPage page1 = ( HtmlPage ) webClient.getPage( url ); > > final ScriptResult result = > page1.executeJavaScriptFunctionIfPossible( ?FunctionXYZ?, ???, > this, null, null ); > > I don't know, which parameters are required. > > Thanks, > Thomas |
From: David D. K. <ddk...@ki...> - 2005-07-15 14:54:13
|
It's probably a missing (or misimplemented) JavaScript feature in Htmlunit. Have you tried using a different browser type by passing in a constant to the WebClient constructor to make it look like a different browser? The default is MSIE 6, I believe. Try the Mozilla 1.0 browser to see if it behaves differently. For example, Google's home page returns different JavaScript depending on the browser type. Htmlunit has a "sanity test" as part of its unit tests that hits the home pages of a variety of external web sites. I would recommend filing a bug on SourceForge about this since it seems to be another good external web site to hit. Dave On Jul 11, 2005, at 1:02 AM, John Smith wrote: > I don't have a specific question per se. However, I am concerned > about HTMLUnit's behavior when I attempt to access ebay.com: > > Code > ------------------ > import java.net.URL; > import com.gargoylesoftware.htmlunit.WebClient; > import com.gargoylesoftware.htmlunit.html.HtmlPage; > > public class Test { > > public static void main( String[] args ) { > > try { > > WebClient webClient = new WebClient(); > webClient.setRedirectEnabled( true ); > > HtmlPage page = ( HtmlPage ) webClient.getPage( new URL( > "http://www.ebay.com" ) ); > > if ( page != null ) { > > System.out.println( page.asXml() ); > } > > } catch ( Exception e ) { > > System.err.println( "Exception: " + e.getMessage() ); > e.printStackTrace(); > } > } > } > > Output > ------------------ > >> java Test >> > Jul 11, 2005 1:51:59 AM > com.gargoylesoftware.htmlunit.javascript.host.Document jsxSet_cookie > INFO: Added cookie: ebay=%5Edv%3D42d208ff%5E > Jul 11, 2005 1:52:00 AM > com.gargoylesoftware.htmlunit.javascript.host.Document jsxSet_cookie > INFO: Added cookie: ebay=%5Edv%3D42d20900%5E > Jul 11, 2005 1:52:04 AM > com.gargoylesoftware.htmlunit.javascript.host.Document jsxSet_cookie > INFO: Added cookie: lucky9=626637 > Exception in thread "main" java.lang.StackOverflowError > at java.net.URLStreamHandler.parseURL(Unknown Source) > at sun.net.www.protocol.file.Handler.parseURL(Unknown Source) > at java.net.URL.<init>(Unknown Source) > at java.net.URL.<init>(Unknown Source) > at sun.misc.URLClassPath$FileLoader.getResource(Unknown > Source) > at sun.misc.URLClassPath$FileLoader.findResource(Unknown > Source) > at sun.misc.URLClassPath.findResource(Unknown Source) > at java.net.URLClassLoader$2.run(Unknown Source) > at java.security.AccessController.doPrivileged(Native Method) > at java.net.URLClassLoader.findResource(Unknown Source) > at java.lang.ClassLoader.getResource(Unknown Source) > at java.lang.ClassLoader.getResourceAsStream(Unknown Source) > at java.util.ResourceBundle$1.run(Unknown Source) > at java.security.AccessController.doPrivileged(Native Method) > at java.util.ResourceBundle.loadBundle(Unknown Source) > at java.util.ResourceBundle.findBundle(Unknown Source) > at java.util.ResourceBundle.getBundleImpl(Unknown Source) > at java.util.ResourceBundle.getBundle(Unknown Source) > at java.util.logging.Level.getLocalizedName(Unknown Source) > at java.util.logging.SimpleFormatter.format(Unknown Source) > at java.util.logging.StreamHandler.publish(Unknown Source) > at java.util.logging.ConsoleHandler.publish(Unknown Source) > at java.util.logging.Logger.log(Unknown Source) > at java.util.logging.Logger.doLog(Unknown Source) > at java.util.logging.Logger.logp(Unknown Source) > at org.apache.commons.logging.impl.Jdk14Logger.log > (Jdk14Logger.java:91) > at org.apache.commons.logging.impl.Jdk14Logger.error > (Jdk14Logger.java:119) > at > com.gargoylesoftware.htmlunit.javascript.StrictErrorReporter.runtimeEr > ror(StrictErrorReporter.java:113) > at org.mozilla.javascript.Context.reportRuntimeError > (Context.java:1054) > at org.mozilla.javascript.Parser.parse(Parser.java:354) > at org.mozilla.javascript.Parser.parse(Parser.java:287) > at org.mozilla.javascript.Context.compileImpl(Context.java: > 2349) > at org.mozilla.javascript.Context.compileString > (Context.java:1372) > at org.mozilla.javascript.ScriptRuntime.evalSpecial > (ScriptRuntime.java:2202) > at org.mozilla.javascript.ScriptRuntime.callSpecial > (ScriptRuntime.java:2071) > at org.mozilla.javascript.Interpreter.interpret > (Interpreter.java:2922) > at org.mozilla.javascript.Interpreter.interpret > (Interpreter.java:2164) > at org.mozilla.javascript.InterpretedFunction.call > (InterpretedFunction.java:140) > at org.mozilla.javascript.ScriptRuntime.evalSpecial > (ScriptRuntime.java:2217) > at org.mozilla.javascript.ScriptRuntime.callSpecial > (ScriptRuntime.java:2071) > at org.mozilla.javascript.Interpreter.interpret > (Interpreter.java:2922) > at org.mozilla.javascript.Interpreter.interpret > (Interpreter.java:2164) > at org.mozilla.javascript.InterpretedFunction.call > (InterpretedFunction.java:140) > at org.mozilla.javascript.ScriptRuntime.evalSpecial > (ScriptRuntime.java:2217) > at org.mozilla.javascript.ScriptRuntime.callSpecial > (ScriptRuntime.java:2071) > at org.mozilla.javascript.Interpreter.interpret > (Interpreter.java:2922) > at org.mozilla.javascript.Interpreter.interpret > (Interpreter.java:2164) > at org.mozilla.javascript.InterpretedFunction.call > (InterpretedFunction.java:140) > at org.mozilla.javascript.ScriptRuntime.evalSpecial > (ScriptRuntime.java:2217) > at org.mozilla.javascript.ScriptRuntime.callSpecial > (ScriptRuntime.java:2071) > at org.mozilla.javascript.Interpreter.interpret > (Interpreter.java:2922) > at org.mozilla.javascript.Interpreter.interpret > (Interpreter.java:2164) > at org.mozilla.javascript.InterpretedFunction.call > (InterpretedFunction.java:140) > at org.mozilla.javascript.ScriptRuntime.evalSpecial > (ScriptRuntime.java:2217) > at org.mozilla.javascript.ScriptRuntime.callSpecial > (ScriptRuntime.java:2071) > at org.mozilla.javascript.Interpreter.interpret > (Interpreter.java:2922) > at org.mozilla.javascript.Interpreter.interpret > (Interpreter.java:2164) > at org.mozilla.javascript.InterpretedFunction.call > (InterpretedFunction.java:140) > at org.mozilla.javascript.ScriptRuntime.evalSpecial > (ScriptRuntime.java:2217) > at org.mozilla.javascript.ScriptRuntime.callSpecial > (ScriptRuntime.java:2071) > at org.mozilla.javascript.Interpreter.interpret > (Interpreter.java:2922) > at org.mozilla.javascript.Interpreter.interpret > (Interpreter.java:2164) > at org.mozilla.javascript.InterpretedFunction.call > (InterpretedFunction.java:140) > at org.mozilla.javascript.ScriptRuntime.evalSpecial > (ScriptRuntime.java:2217) > ... > > * Note: The last five stack trace lines keep repeating (hence the ...) > > Does anyone have any suggestions or explanations? Thanks. > |
From: David D. K. <ddk...@ki...> - 2005-07-15 14:48:57
|
Shouldn't the web server be smart enough NOT to send compressed responses if the client doesn't advertise that it can handle them? I'm pretty sure the client must tell the web server if it can handle compressed responses, and if it can't, then the web server shouldn't send them back. Are you adding an HTTP header to the outgoing request to advertise this from within Htmlunit? Or is the web server "forcing" compressed content on Htmlunit, and if so, what web server are you using? Dave On Jul 11, 2005, at 1:43 PM, Brad Clarke wrote: > I would think that would be a httpclient thing, but they seem to > have dumped it off > to their client applications: > > http://mail-archives.apache.org/mod_mbox/jakarta-httpclient-user/ > 200502.mbox/%3C4...@ya...%3E > > Doesn't look hard but I've no way to test it so I wouldn't know if > it worked. If > you'd like to submit a patch it would be appreciated :) > > > Brad C > > --- Ritesh Trivedi <ru...@ya...> wrote: > > >> Hi, >> >> Looks like HTMLUnit is not handling the compressed responses from >> the http server >> (http 1.1). Most of the browsers seem to uncompress the response >> from the server >> based on (content-encoding http response header value) and render >> the page. >> >> Does HTMLUnit have any support for compressed response? >> >> Thanks >> Ritesh >> |
From: David D. K. <ddk...@ki...> - 2005-07-15 14:43:45
|
If this behavior is contrary to what current web browsers do (which I think you said it was in a previous message), I would recommend opening a bug on SourceForge and writing a small JUnit test case that demonstrates the problem. Dave On Jul 12, 2005, at 2:34 AM, Kim Hoogenberg wrote: > Hello, > > Why is it that after parsing my javascript, whenever I use > table.removeRow or table.removeChild(someTBody), no row is removed. > Instead, only the data inside of those rows is deleted. > > Has anyone had the same problems? > > Thanks, > > Kim Hoogenberg |
From: Javier G <jav...@ya...> - 2005-07-15 09:27:29
|
well, I got it. now it works; here is the code in case other users has the same problem (i didn´t found anything similar in the archive). final WebClient webClient = new WebClient( BrowserVersion.MOZILLA_1_0, "my.corporative.proxy", 8080); final DefaultCredentialsProvider scp = new DefaultCredentialsProvider(); scp.addProxyCredentials("user", "password","my.corporative.proxy",8080); webClient.setCredentialsProvider(scp); final URL url = new URL("http://htmlunit.sourceforge.net"); final HtmlPage page = (HtmlPage)webClient.getPage(url); Assert.assertEquals( "htmlunit - Welcome to HtmlUnit", page.getTitleText() ); --------------------------------- Correo Yahoo! Comprueba qué es nuevo, aquí http://correo.yahoo.es |
From: Marc G. <mgu...@ya...> - 2005-07-15 09:03:58
|
Hi, I don't use htmlunit through a proxy but I think that you have to use the WebClient c'tor with 3 args: http://htmlunit.sourceforge.net/apidocs/com/gargoylesoftware/htmlunit/WebClient.html#WebClient(com.gargoylesoftware.htmlunit.BrowserVersion,%20java.lang.String,%20int) Marc. Javier G wrote: > Hello, I´m a novice in htmlunit, trying to using it through a > corporative proxy. > it´s the same error as if proxy authentication were not used. > This is the code i´m using, but it always throws UnknowHostException. > > Thanks in advance! > > import com.gargoylesoftware.htmlunit.*; > import com.gargoylesoftware.htmlunit.html.*; > import junit.framework.Assert; > import java.net.*; > import org.apache.commons.httpclient.auth.CredentialsProvider; > import com.gargoylesoftware.htmlunit.DefaultCredentialsProvider; > > ... > > public void test_auHomePage() throws Exception { > final WebClient webClient = new WebClient(); > final DefaultCredentialsProvider scp = new DefaultCredentialsProvider(); > scp.addProxyCredentials("user", "password","corporative.proxy",8080); > webClient.setCredentialsProvider(scp); > > final URL url = new URL("http://htmlunit.sourceforge.net"); > final HtmlPage page = (HtmlPage)webClient.getPage(url); > Assert.assertEquals( "htmlunit - Welcome to HtmlUnit", > page.getTitleText() ); > > > ------------------------------------------------------------------------ > > Correo Yahoo! > Comprueba qué es nuevo, aquí > <http://us.rd.yahoo.com/mail/es/whatsnew/*http://es.whatsnew.mail.yahoo.com/> > http://correo.yahoo.es |
From: Javier G <jav...@ya...> - 2005-07-15 08:20:19
|
Hello, I´m a novice in htmlunit, trying to using it through a corporative proxy. it´s the same error as if proxy authentication were not used. This is the code i´m using, but it always throws UnknowHostException. Thanks in advance! import com.gargoylesoftware.htmlunit.*; import com.gargoylesoftware.htmlunit.html.*; import junit.framework.Assert; import java.net.*; import org.apache.commons.httpclient.auth.CredentialsProvider; import com.gargoylesoftware.htmlunit.DefaultCredentialsProvider; ... public void test_auHomePage() throws Exception { final WebClient webClient = new WebClient(); final DefaultCredentialsProvider scp = new DefaultCredentialsProvider(); scp.addProxyCredentials("user", "password","corporative.proxy",8080); webClient.setCredentialsProvider(scp); final URL url = new URL("http://htmlunit.sourceforge.net"); final HtmlPage page = (HtmlPage)webClient.getPage(url); Assert.assertEquals( "htmlunit - Welcome to HtmlUnit", page.getTitleText() ); --------------------------------- Correo Yahoo! Comprueba qué es nuevo, aquí http://correo.yahoo.es |
From: Kim H. <kim...@vi...> - 2005-07-12 07:33:10
|
Hello, Why is it that after parsing my javascript, whenever I use table.removeRow or table.removeChild(someTBody), no row is removed. Instead, only the data inside of those rows is deleted. Has anyone had the same problems? Thanks, Kim Hoogenberg |
From: Marco M. <ma...@ma...> - 2005-07-11 20:24:24
|
Brad Clarke wrote: > It's already in the HTML parser. Also, the param attribute doesn't look valid. > Adding anything more than basic support for one object type is going to become > complex very quickly so you're going to have to be much more specific about what > you're looking for. I was trying to replicate a custom object (an input field) that is created the way I wrote and provides some custom methods. The param attribute is in the form accepted by the custom object. I managed to get this working by hacking the source code. I tried to extend the library and provide an extension mechanism similar to the activex objects but I wasn't able to get too far. In the meantime I also dropped htmlunit due to the problems I had testing the javascript code. Bye |
From: Brad C. <yo...@br...> - 2005-07-11 19:38:11
|
The only way that little bit of code could blow stack is if you clicked the Page, which doesn't seem like a very valid thing to do and doesn't sound very likely. Brad C --- Lucas Gonçalves <luc...@po...> wrote: > L have a problem with javascript very strange! > My page have a button > <input type="button" name="evento" value="F7-Novo" > onclick="setBotaoAcao(getBotaoArray('INCLUIR')); > redirect('/ecp/aplicacao.do?evento=x');"> > and when click on it, return a exception java.lang.stackoverflow! > When l was analyzing l found the problem in DomNode Class in this method > > public Object getScriptObject() { > if (scriptObject_ == null) { > scriptObject_ = ((SimpleScriptable) > getPage().getScriptObject()).makeScriptableFor(this); > } > return scriptObject_; > } > This method was called by ClickableElement class in public Page Click(){..} > It´s strange because this method ever throw a exception(when scriptObject is > null on the first time, stop and analize it); > What this method do? > L can´t understand how everybody can use javascript onclick event, if this > method is wrong! > HELP ME, l´m pulling out my hair!! > > > Lucas Gonçalves - PowerLogic |
From: Marc G. <mgu...@ya...> - 2005-07-11 19:37:19
|
Hi, in htmlunit DOM objects have associated JavaScript host objects for javascript execution. The js host objects are only created when needed, therefore getScriptObject(). It seem that in you case the logic of this creation fails. Can you try to minimize the code producing the error and then open a but issue? Marc. Lucas Gonçalves wrote: > L have a problem with javascript very strange! > My page have a button > <input type="button" name="evento" value="F7-Novo" > onclick="setBotaoAcao(getBotaoArray('INCLUIR')); > redirect('/ecp/aplicacao.do?evento=x');"> > and when click on it, return a exception java.lang.stackoverflow! > When l was analyzing l found the problem in DomNode Class in this method > > public Object getScriptObject() { > if (scriptObject_ == null) { > scriptObject_ = ((SimpleScriptable) > getPage().getScriptObject()).makeScriptableFor(this); > } > return scriptObject_; > } > This method was called by ClickableElement class in public Page Click(){..} > It´s strange because this method ever throw a exception(when scriptObject is > null on the first time, stop and analize it); > What this method do? > L can´t understand how everybody can use javascript onclick event, if this > method is wrong! > HELP ME, l´m pulling out my hair!! > > > Lucas Gonçalves - PowerLogic > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening > July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual > core and dual graphics technology at this free one hour event hosted by HP, > AMD, and NVIDIA. To register visit http://www.hp.com/go/dualwebinar > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > |
From: <luc...@po...> - 2005-07-11 19:29:09
|
L have a problem with javascript very strange! My page have a button <input type="button" name="evento" value="F7-Novo" onclick="setBotaoAcao(getBotaoArray('INCLUIR')); redirect('/ecp/aplicacao.do?evento=x');"> and when click on it, return a exception java.lang.stackoverflow! When l was analyzing l found the problem in DomNode Class in this method public Object getScriptObject() { if (scriptObject_ == null) { scriptObject_ = ((SimpleScriptable) getPage().getScriptObject()).makeScriptableFor(this); } return scriptObject_; } This method was called by ClickableElement class in public Page Click(){..} It´s strange because this method ever throw a exception(when scriptObject is null on the first time, stop and analize it); What this method do? L can´t understand how everybody can use javascript onclick event, if this method is wrong! HELP ME, l´m pulling out my hair!! Lucas Gonçalves - PowerLogic |
From: Brad C. <yo...@br...> - 2005-07-11 18:44:04
|
I would think that would be a httpclient thing, but they seem to have dumped it off to their client applications: http://mail-archives.apache.org/mod_mbox/jakarta-httpclient-user/200502.mbox/%3C4...@ya...%3E Doesn't look hard but I've no way to test it so I wouldn't know if it worked. If you'd like to submit a patch it would be appreciated :) Brad C --- Ritesh Trivedi <ru...@ya...> wrote: > Hi, > > Looks like HTMLUnit is not handling the compressed responses from the http server > (http 1.1). Most of the browsers seem to uncompress the response from the server > based on (content-encoding http response header value) and render the page. > > Does HTMLUnit have any support for compressed response? > > Thanks > Ritesh > |
From: Brad C. <yo...@br...> - 2005-07-11 18:37:08
|
It's already in the HTML parser. Also, the param attribute doesn't look valid. Adding anything more than basic support for one object type is going to become complex very quickly so you're going to have to be much more specific about what you're looking for. Brad C --- Marco Maccaferri <ma...@ma...> wrote: > Hi. > > I need to test a page with a custom html object in the form: > > <object id="myobj" classid="clsid:XXXXX" param="a"></object> > > I tried the ActiveX object map using the classid but seems to have no > effect. > > Is there any document that explains how to add a custom object to the > html parser ? > > Bye > |
From: John S. <tra...@gm...> - 2005-07-11 06:02:19
|
I don't have a specific question per se. However, I am concerned about HTMLUnit's behavior when I attempt to access ebay.com: Code ------------------ import java.net.URL; import com.gargoylesoftware.htmlunit.WebClient; import com.gargoylesoftware.htmlunit.html.HtmlPage; public class Test { public static void main( String[] args ) { try { WebClient webClient =3D new WebClient(); webClient.setRedirectEnabled( true ); =20 HtmlPage page =3D ( HtmlPage ) webClient.getPage( new URL( "http://www.ebay.com" ) ); if ( page !=3D null ) { System.out.println( page.asXml() ); } } catch ( Exception e ) { System.err.println( "Exception: " + e.getMessage() ); e.printStackTrace(); } } } Output ------------------ > java Test Jul 11, 2005 1:51:59 AM com.gargoylesoftware.htmlunit.javascript.host.Document jsxSet_cookie INFO: Added cookie: ebay=3D%5Edv%3D42d208ff%5E Jul 11, 2005 1:52:00 AM com.gargoylesoftware.htmlunit.javascript.host.Document jsxSet_cookie INFO: Added cookie: ebay=3D%5Edv%3D42d20900%5E Jul 11, 2005 1:52:04 AM com.gargoylesoftware.htmlunit.javascript.host.Document jsxSet_cookie INFO: Added cookie: lucky9=3D626637 Exception in thread "main" java.lang.StackOverflowError at java.net.URLStreamHandler.parseURL(Unknown Source) at sun.net.www.protocol.file.Handler.parseURL(Unknown Source) at java.net.URL.<init>(Unknown Source) at java.net.URL.<init>(Unknown Source) at sun.misc.URLClassPath$FileLoader.getResource(Unknown Source) at sun.misc.URLClassPath$FileLoader.findResource(Unknown Source) at sun.misc.URLClassPath.findResource(Unknown Source) at java.net.URLClassLoader$2.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findResource(Unknown Source) at java.lang.ClassLoader.getResource(Unknown Source) at java.lang.ClassLoader.getResourceAsStream(Unknown Source) at java.util.ResourceBundle$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.util.ResourceBundle.loadBundle(Unknown Source) at java.util.ResourceBundle.findBundle(Unknown Source) at java.util.ResourceBundle.getBundleImpl(Unknown Source) at java.util.ResourceBundle.getBundle(Unknown Source) at java.util.logging.Level.getLocalizedName(Unknown Source) at java.util.logging.SimpleFormatter.format(Unknown Source) at java.util.logging.StreamHandler.publish(Unknown Source) at java.util.logging.ConsoleHandler.publish(Unknown Source) at java.util.logging.Logger.log(Unknown Source) at java.util.logging.Logger.doLog(Unknown Source) at java.util.logging.Logger.logp(Unknown Source) at org.apache.commons.logging.impl.Jdk14Logger.log(Jdk14Logger.java= :91) at org.apache.commons.logging.impl.Jdk14Logger.error(Jdk14Logger.ja= va:119) at com.gargoylesoftware.htmlunit.javascript.StrictErrorReporter.run= timeError(StrictErrorReporter.java:113) at org.mozilla.javascript.Context.reportRuntimeError(Context.java:1= 054) at org.mozilla.javascript.Parser.parse(Parser.java:354) at org.mozilla.javascript.Parser.parse(Parser.java:287) at org.mozilla.javascript.Context.compileImpl(Context.java:2349) at org.mozilla.javascript.Context.compileString(Context.java:1372) at org.mozilla.javascript.ScriptRuntime.evalSpecial(ScriptRuntime.j= ava:2202) at org.mozilla.javascript.ScriptRuntime.callSpecial(ScriptRuntime.j= ava:2071) at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:29= 22) at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:21= 64) at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunct= ion.java:140) at org.mozilla.javascript.ScriptRuntime.evalSpecial(ScriptRuntime.j= ava:2217) at org.mozilla.javascript.ScriptRuntime.callSpecial(ScriptRuntime.j= ava:2071) at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:29= 22) at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:21= 64) at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunct= ion.java:140) at org.mozilla.javascript.ScriptRuntime.evalSpecial(ScriptRuntime.j= ava:2217) at org.mozilla.javascript.ScriptRuntime.callSpecial(ScriptRuntime.j= ava:2071) at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:29= 22) at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:21= 64) at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunct= ion.java:140) at org.mozilla.javascript.ScriptRuntime.evalSpecial(ScriptRuntime.j= ava:2217) at org.mozilla.javascript.ScriptRuntime.callSpecial(ScriptRuntime.j= ava:2071) at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:29= 22) at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:21= 64) at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunct= ion.java:140) at org.mozilla.javascript.ScriptRuntime.evalSpecial(ScriptRuntime.j= ava:2217) at org.mozilla.javascript.ScriptRuntime.callSpecial(ScriptRuntime.j= ava:2071) at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:29= 22) at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:21= 64) at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunct= ion.java:140) at org.mozilla.javascript.ScriptRuntime.evalSpecial(ScriptRuntime.j= ava:2217) at org.mozilla.javascript.ScriptRuntime.callSpecial(ScriptRuntime.j= ava:2071) at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:29= 22) at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:21= 64) at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunct= ion.java:140) at org.mozilla.javascript.ScriptRuntime.evalSpecial(ScriptRuntime.j= ava:2217) ... * Note: The last five stack trace lines keep repeating (hence the ...) Does anyone have any suggestions or explanations? Thanks. |
From: Zbigniew K. <ch...@wp...> - 2005-07-07 14:07:24
|
I'have a little problem :) Part of my web page is written in JavaScript. There are implemented couple methods. One of those look as follows: function getWidth() { var width=window.innerWidth; if (width==null) width=document.body.offsetWidth; return w; } When I try to test that page using settings for Mozilla: final WebClient webClient = new WebClient(BrowserVersion.MOZILLA_1_0); everythigs worked ok, the property window.innerWidth returned proper value of window width, but problem arrived when I switched configuration to: final WebClient webClient = new WebClient(BrowserVersion.INTERNET_EXPLORER_6_0); Now document.body.offsetWidth returns nothing. I tried to add another property in JavaScriptConfiguration.xml file: <property name="clientWidth" readable="true" writable="false"/> <property name="clientHeight" readable="true" writable="false"/> and I change offsetWidth to clientWidth in getWidth function, but this solution doesn't solve the problem. Is there some possibility to get size of the document (or window) in such a way, that hmtlunit works with it ok in both (Mozilla and IE) situations? Or maybe htmlunit can be configured in some other way? Best regards Zbyhoo ---------------------------------------------------- Zadbaj o bezpieczne wakacje nad wodą! Włącz się w Bezpieczne lato z NIVEA i WOPR http://klik.wp.pl/?adr=www.sport.wp.pl%2Fnivea-wopr.html&sid=427 |