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: Ahmed A. <asa...@ya...> - 2014-02-07 01:54:04
|
Hi Tom, Hope you are you latest HtmlUnit version/snapshot. GWT AJAX example is correctly handled. Is there a way to send the public URL of the web app? Or you can send the whole project so others can see. Ahmed > On Feb 7, 2014, at 4:00 AM, "Ruff, Thomas" <Tho...@so...> wrote: > > I'm trying to test a GWT application by filling out some input fields and clicking on a button. When I do this in IE or Chrome the outputDiv I'm looking for is modified via AJAX after clicking on the Calculate button but when I run my test case that div is left unmodified (its original text node value is left unchanged). I've tried waitForBackgroundJavaScript(), waitForBackgroundJavaScriptStartingBefore(), wait() and sleep(), but nothing seems to make a difference. Has anyone else been able to succeed in testing GWT pages that modify themselves with the result of AJAX calls? Do you see anything wrong with my test? > > > public class MyTest { > @Test > public void calcDensityAltitude() throws Exception { > WebClient webClient = new WebClient(BrowserVersion.INTERNET_EXPLORER_8); > webClient.setAjaxController(new NicelyResynchronizingAjaxController()); > HtmlPage page = webClient.getPage("http://mypage"); > page.getWebClient().waitForBackgroundJavaScript(10000); > try { > //set input fields > HtmlInput elevation = page.getHtmlElementById("myId"); > elevation.setValueAttribute("30.0"); > HtmlDivision calButton = page.getFirstByXPath("//*[text()='Calculate']"); > page.getWebClient().waitForBackgroundJavaScript(10000); > page = calButton.click(); > page.getWebClient().waitForBackgroundJavaScript(10000); > //try 20 times to wait .5 second each for filling the page. > HtmlLabel outputDiv=null; > for (int i = 0; i < 20; i++) { > outputDiv = page.getFirstByXPath("//*[text()='11422']"); > if (null != outputDiv) { > break; > } > synchronized (page) { //also tried to sleep() instead > page.wait(500); > } > } > int remainingTasks = page.getWebClient().waitForBackgroundJavaScript(10000); > System.out.println("remaining JS tasks: " + remainingTasks); > > System.out.println(page.asXml()); > Assert.assertNotNull(outputDiv); > String output = outputDiv.getTextContent(); > System.out.println("Desity Altitude: " + output); > } catch (...) {...} > webClient.closeAllWindows(); > } > } > > Thanks, > Tom |
From: Ruff, T. <Tho...@so...> - 2014-02-07 01:00:22
|
I'm trying to test a GWT application by filling out some input fields and clicking on a button. When I do this in IE or Chrome the outputDiv I'm looking for is modified via AJAX after clicking on the Calculate button but when I run my test case that div is left unmodified (its original text node value is left unchanged). I've tried waitForBackgroundJavaScript(), waitForBackgroundJavaScriptStartingBefore(), wait() and sleep(), but nothing seems to make a difference. Has anyone else been able to succeed in testing GWT pages that modify themselves with the result of AJAX calls? Do you see anything wrong with my test? public class MyTest { @Test public void calcDensityAltitude() throws Exception { WebClient webClient = new WebClient(BrowserVersion.INTERNET_EXPLORER_8); webClient.setAjaxController(new NicelyResynchronizingAjaxController()); HtmlPage page = webClient.getPage("http://mypage"); page.getWebClient().waitForBackgroundJavaScript(10000); try { //set input fields HtmlInput elevation = page.getHtmlElementById("myId"); elevation.setValueAttribute("30.0"); HtmlDivision calButton = page.getFirstByXPath("//*[text()='Calculate']"); page.getWebClient().waitForBackgroundJavaScript(10000); page = calButton.click(); page.getWebClient().waitForBackgroundJavaScript(10000); //try 20 times to wait .5 second each for filling the page. HtmlLabel outputDiv=null; for (int i = 0; i < 20; i++) { outputDiv = page.getFirstByXPath("//*[text()='11422']"); if (null != outputDiv) { break; } synchronized (page) { //also tried to sleep() instead page.wait(500); } } int remainingTasks = page.getWebClient().waitForBackgroundJavaScript(10000); System.out.println("remaining JS tasks: " + remainingTasks); System.out.println(page.asXml()); Assert.assertNotNull(outputDiv); String output = outputDiv.getTextContent(); System.out.println("Desity Altitude: " + output); } catch (...) {...} webClient.closeAllWindows(); } } Thanks, Tom |
From: Ronald B. <rb...@rb...> - 2014-02-06 17:37:58
|
There are two login elements on the page, you have to click the right one :-) RBRi On Thu, 6 Feb 2014 09:25:01 -0800 (PST) Ahmed Ashour wrote: > >Hi Ronald, > >For the below, I am not able to correctly login. > > > final WebClient webClient = new WebClient(BrowserVersion.CHROME); > final HtmlPage page = webClient.getPage("http://mrbs.sourceforge.net/mrbs/admin.php"); > page.<HtmlInput>getHtmlElementById("NewUserName").type("admin"); > page.<HtmlInput>getHtmlElementById("NewUserPassword").type("admin"); > HtmlPage page2 = page.<HtmlInput>getHtmlElementById("NewUserName").click(); > System.out.println(page2.asText()); > > >It gives: > >"Unknown user >Log in >You do not have the necessary rights to view this page." > >Ahmed >From: Ronald Brill <rb...@rb...> >To: "htm...@li..." <htm...@li...>; "rg...@gm..." <rg...@gm...> >Sent: Thursday, February 6, 2014 8:04 PM >Subject: Re: [Htmlunit-user] First obstacles, javascript exception for MRBS. > > >On Thu, 06 Feb 2014 16:47:44 +0100 rg...@gm... wrote: >> >>Am 05.02.2014 21:55, schrieb Ronald Brill: >>>> >/usr/share/htmlunit-2.8.jar -- for WebSite and other classes. >>>> > >>> The current release version is 2.13 and 2.14 will be available shortly. >>> So start with the latest release or download the lastes snapshot from http://build.canoo.com/htmlunit/artifacts/. >>> >>> RBRi >> >> >>Dear Ronald, >> >>thanks for pointing this out. Now, I got the most recent >>version including all dependencies. I took a while until >>I managed to add missing libraries to the classpath list >>one by one, as I use quite a basic build environment called >>BlueJ. Is there a project file to start with, either for >>Eclipse or Netbeans? > >Hi Ralf, > >you are really sure that you use the latest snapshot. >I did a quick WETATOR test with the latest HtmlUnit and friends and it works fine. >Was able to login without any problem. > >Or was there any change on the webpage itself in between? > > > RBRi > |
From: Ahmed A. <asa...@ya...> - 2014-02-06 17:28:06
|
Hi Ronald, For the below, I am not able to correctly login. final WebClient webClient = new WebClient(BrowserVersion.CHROME); final HtmlPage page = webClient.getPage("http://mrbs.sourceforge.net/mrbs/admin.php"); page.<HtmlInput>getHtmlElementById("NewUserName").type("admin"); page.<HtmlInput>getHtmlElementById("NewUserPassword").type("admin"); HtmlPage page2 = page.<HtmlInput>getHtmlElementById("NewUserName").click(); System.out.println(page2.asText()); It gives: "Unknown user Log in You do not have the necessary rights to view this page." Ahmed From: Ronald Brill <rb...@rb...> To: "htm...@li..." <htm...@li...>; "rg...@gm..." <rg...@gm...> Sent: Thursday, February 6, 2014 8:04 PM Subject: Re: [Htmlunit-user] First obstacles, javascript exception for MRBS. On Thu, 06 Feb 2014 16:47:44 +0100 rg...@gm... wrote: > >Am 05.02.2014 21:55, schrieb Ronald Brill: >>> >/usr/share/htmlunit-2.8.jar -- for WebSite and other classes. >>> > >> The current release version is 2.13 and 2.14 will be available shortly. >> So start with the latest release or download the lastes snapshot from http://build.canoo.com/htmlunit/artifacts/. >> >> RBRi > > >Dear Ronald, > >thanks for pointing this out. Now, I got the most recent >version including all dependencies. I took a while until >I managed to add missing libraries to the classpath list >one by one, as I use quite a basic build environment called >BlueJ. Is there a project file to start with, either for >Eclipse or Netbeans? Hi Ralf, you are really sure that you use the latest snapshot. I did a quick WETATOR test with the latest HtmlUnit and friends and it works fine. Was able to login without any problem. Or was there any change on the webpage itself in between? RBRi |
From: Ronald B. <rb...@rb...> - 2014-02-06 17:04:34
|
On Thu, 06 Feb 2014 16:47:44 +0100 rg...@gm... wrote: > >Am 05.02.2014 21:55, schrieb Ronald Brill: >>> >/usr/share/htmlunit-2.8.jar -- for WebSite and other classes. >>> > >> The current release version is 2.13 and 2.14 will be available shortly. >> So start with the latest release or download the lastes snapshot from http://build.canoo.com/htmlunit/artifacts/. >> >> RBRi > > >Dear Ronald, > >thanks for pointing this out. Now, I got the most recent >version including all dependencies. I took a while until >I managed to add missing libraries to the classpath list >one by one, as I use quite a basic build environment called >BlueJ. Is there a project file to start with, either for >Eclipse or Netbeans? Hi Ralf, you are really sure that you use the latest snapshot. I did a quick WETATOR test with the latest HtmlUnit and friends and it works fine. Was able to login without any problem. Or was there any change on the webpage itself in between? RBRi >Now, these libs are listed user.libraries: > >> /home/me/JAVA/htmlunit-2.14-SNAPSHOT/lib/nekohtml-1.9.20-20140123.095453-1.jar >> /home/me/JAVA/htmlunit-2.14-SNAPSHOT/lib/jetty-http-8.1.14.v20131031.jar >> /home/me/JAVA/htmlunit-2.14-SNAPSHOT/lib/commons-io-2.4.jar >> /home/me/JAVA/htmlunit-2.14-SNAPSHOT/lib/commons-codec-1.9.jar >> /home/me/JAVA/htmlunit-2.14-SNAPSHOT/lib/sac-1.3.jar >> /home/me/JAVA/htmlunit-2.14-SNAPSHOT/lib/jetty-io-8.1.14.v20131031.jar >> /home/me/JAVA/htmlunit-2.14-SNAPSHOT/lib/commons-lang3-3.2.1.jar >> /home/me/JAVA/htmlunit-2.14-SNAPSHOT/lib/htmlunit-core-js-2.14-20140203.084841-5.jar >> /home/me/JAVA/htmlunit-2.14-SNAPSHOT/lib/httpclient-4.3.2.jar >> /home/me/JAVA/htmlunit-2.14-SNAPSHOT/lib/serializer-2.7.1.jar >> /home/me/JAVA/htmlunit-2.14-SNAPSHOT/lib/commons-collections-3.2.1.jar >> /home/me/JAVA/htmlunit-2.14-SNAPSHOT/lib/commons-logging-1.1.3.jar >> /home/me/JAVA/htmlunit-2.14-SNAPSHOT/lib/htmlunit-2.14-SNAPSHOT.jar >> /home/me/JAVA/htmlunit-2.14-SNAPSHOT/lib/httpcore-4.3.1.jar >> /home/me/JAVA/htmlunit-2.14-SNAPSHOT/lib/xalan-2.7.1.jar >> /home/me/JAVA/htmlunit-2.14-SNAPSHOT/lib/cssparser-0.9.13.jar >> /usr/share/java/junit4-4.11.jar >> /home/me/JAVA/htmlunit-2.14-SNAPSHOT/lib/jetty-websocket-8.1.14.v20131031.jar >> /home/me/JAVA/htmlunit-2.14-SNAPSHOT/lib/httpmime-4.3.2.jar >> /home/me/JAVA/htmlunit-2.14-SNAPSHOT/lib/xercesImpl-2.11.0.jar >> /home/me/JAVA/htmlunit-2.14-SNAPSHOT/lib/xml-apis-1.4.01.jar > >Now, my method returns again this exception (now running as FIREFOX_24) >when calling > final HtmlPage page = > webClient.getPage("http://mrbs.HIDDEN.URL/admin.php"); > >There is an open demo server or mrbs, cf. >http://mrbs.sourceforge.net/mrbs/admin.php (login admin/admin). > > >(The exception occurs about after 7 seconds) > >A. Error Console Output > >> Feb 06, 2014 4:43:20 PM com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error >> WARNING: CSS error: 'http://mrbs.HIDDEN.URL/jquery/datatables/css/mrbs-table.css' [88:3] Error in style rule. (Invalid token "*". Was expecting one of: <EOF>, <S>, <IDENT>, "}", ";".) >> Feb 06, 2014 4:43:20 PM com.gargoylesoftware.htmlunit.DefaultCssErrorHandler warning >> WARNING: CSS warning: 'http://mrbs.HIDDEN.URL/jquery/datatables/css/mrbs-table.css' [88:3] Ignoring the following declarations in this rule. >> Feb 06, 2014 4:43:21 PM com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error >> WARNING: CSS error: 'http://mrbs.HIDDEN.URL/jquery/datatables/css/mrbs-table.css' [262:3] Error in style rule. (Invalid token "*". Was expecting one of: <EOF>, <S>, <IDENT>, "}", ";".) >> Feb 06, 2014 4:43:21 PM com.gargoylesoftware.htmlunit.DefaultCssErrorHandler warning >> WARNING: CSS warning: 'http://mrbs.HIDDEN.URL/jquery/datatables/css/mrbs-table.css' [262:3] Ignoring the following declarations in this rule. >> Feb 06, 2014 4:43:21 PM com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error >> WARNING: CSS error: 'http://mrbs.HIDDEN.URL/jquery/datatables/css/mrbs-table.css' [323:3] Error in style rule. (Invalid token "*". Was expecting one of: <EOF>, <S>, <IDENT>, "}", ";".) >> Feb 06, 2014 4:43:21 PM com.gargoylesoftware.htmlunit.DefaultCssErrorHandler warning >> WARNING: CSS warning: 'http://mrbs.HIDDEN.URL/jquery/datatables/css/mrbs-table.css' [323:3] Ignoring the following declarations in this rule. >> Feb 06, 2014 4:43:21 PM com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error >> WARNING: CSS error: 'http://mrbs.HIDDEN.URL/jquery/datatables/css/ColVis.css' [19:2] Error in style rule. (Invalid token "*". Was expecting one of: <EOF>, <S>, <IDENT>, "}", ";".) >> Feb 06, 2014 4:43:21 PM com.gargoylesoftware.htmlunit.DefaultCssErrorHandler warning >> WARNING: CSS warning: 'http://mrbs.HIDDEN.URL/jquery/datatables/css/ColVis.css' [19:2] Ignoring the following declarations in this rule. >> Feb 06, 2014 4:43:25 PM com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify >> WARNING: Obsolete content type encountered: 'application/x-javascript'. >> Feb 06, 2014 4:43:26 PM com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify >> WARNING: Obsolete content type encountered: 'application/x-javascript'. >> Feb 06, 2014 4:43:26 PM com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify >> WARNING: Obsolete content type encountered: 'application/x-javascript'. >> Feb 06, 2014 4:43:26 PM com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify >> WARNING: Obsolete content type encountered: 'application/x-javascript'. >> Feb 06, 2014 4:43:26 PM com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify >> WARNING: Obsolete content type encountered: 'application/x-javascript'. >> Feb 06, 2014 4:43:26 PM com.gargoylesoftware.htmlunit.html.InputElementFactory createElementNS >> INFO: Bad input type: "search", creating a text input > > > > >B. Console Output: > >> test11.mrbsPage(); >> ======= EXCEPTION START ======== >> EcmaError: lineNumber=[23] column=[0] lineSource=[null] name=[TypeError] sourceName=[http://mrbs.HIDDEN.URL/js/general.js.php?area=0] message=[TypeError: Cannot call method "indexOf" of undefined >(http://mrbs.HIDDEN.URL/js/general.js.php?area=0#23)] >> com.gargoylesoftware.htmlunit.ScriptException: TypeError: Cannot call method "indexOf" of undefined (http://mrbs.HIDDEN.URL/js/general.js.php?area=0#23) >> at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:689) >> at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:620) >> at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:513) >> at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:621) >> at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:596) >> at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptFunctionIfPossible(HtmlPage.java:990) >> at com.gargoylesoftware.htmlunit.javascript.host.EventListenersContainer.executeEventListeners(EventListenersContainer.java:179) >> at com.gargoylesoftware.htmlunit.javascript.host.EventListenersContainer.executeBubblingListeners(EventListenersContainer.java:239) >> at com.gargoylesoftware.htmlunit.javascript.host.Node.fireEvent(Node.java:837) >> at com.gargoylesoftware.htmlunit.javascript.host.Node.fireEvent(Node.java:761) >> at com.gargoylesoftware.htmlunit.html.HtmlElement$1.run(HtmlElement.java:915) >> at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:620) >> at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:513) >> at com.gargoylesoftware.htmlunit.html.HtmlElement.fireEvent(HtmlElement.java:920) >> at com.gargoylesoftware.htmlunit.html.HtmlPage.executeEventHandlersIfNeeded(HtmlPage.java:1287) >> at com.gargoylesoftware.htmlunit.html.HtmlPage.initialize(HtmlPage.java:279) >> at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:462) >> at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:329) >> at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:394) >> at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:379) >> at test1.mrbsPage(test1.java:28) >> Caused by: net.sourceforge.htmlunit.corejs.javascript.EcmaError: TypeError: Cannot call method "indexOf" of undefined (http://mrbs.HIDDEN.URL/js/general.js.php?area=0#23) >> at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3628) >> at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3612) >> at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3633) >> at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:3649) >> at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.undefCallError(ScriptRuntime.java:3663) >> at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.getPropFunctionAndThisHelper(ScriptRuntime.java:2220) >> at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.getPropFunctionAndThis(ScriptRuntime.java:2214) >> at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpretLoop(Interpreter.java:1333) >> at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpret(Interpreter.java:798) >> at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call(InterpretedFunction.java:105) >> at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.doTopCall(ContextFactory.java:411) >> at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.doTopCall(HtmlUnitContextFactory.java:309) >> at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3056) >> at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call(InterpretedFunction.java:103) >> at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$4.doRun(JavaScriptEngine.java:614) >> at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:674) >> at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:620) >> at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:513) >> at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:621) >> at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:596) >> at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptFunctionIfPossible(HtmlPage.java:990) >> at com.gargoylesoftware.htmlunit.javascript.host.EventListenersContainer.executeEventListeners(EventListenersContainer.java:179) >> at com.gargoylesoftware.htmlunit.javascript.host.EventListenersContainer.executeBubblingListeners(EventListenersContainer.java:239) >> at com.gargoylesoftware.htmlunit.javascript.host.Node.fireEvent(Node.java:837) >> at com.gargoylesoftware.htmlunit.javascript.host.Node.fireEvent(Node.java:761) >> at com.gargoylesoftware.htmlunit.html.HtmlElement$1.run(HtmlElement.java:915) >> at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:620) >> at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:513) >> at com.gargoylesoftware.htmlunit.html.HtmlElement.fireEvent(HtmlElement.java:920) >> at com.gargoylesoftware.htmlunit.html.HtmlPage.executeEventHandlersIfNeeded(HtmlPage.java:1287) >> at com.gargoylesoftware.htmlunit.html.HtmlPage.initialize(HtmlPage.java:279) >> at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:462) >> at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:329) >> at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:394) >> at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:379) >> at test1.mrbsPage(test1.java:28) >> at __SHELL1.run(__SHELL1.java:8) >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) >> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) >> at java.lang.reflect.Method.invoke(Method.java:606) >> at bluej.runtime.ExecServer$3.run(ExecServer.java:730) >> Enclosed exception: >> net.sourceforge.htmlunit.corejs.javascript.EcmaError: TypeError: Cannot call method "indexOf" of undefined (http://mrbs.HIDDEN.URL/js/general.js.php?area=0#23) >> at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3628) >> at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3612) >> at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3633) >> at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:3649) >> at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.undefCallError(ScriptRuntime.java:3663) >> at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.getPropFunctionAndThisHelper(ScriptRuntime.java:2220) >> at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.getPropFunctionAndThis(ScriptRuntime.java:2214) >> at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpretLoop(Interpreter.java:1333) >> at script(http://mrbs.HIDDEN.URL/js/general.js.php?area=0:23) >> at script(script in http://mrbs.HIDDEN.URL/admin.php from (101, 32) to (123, 10):117) >> at script(http://mrbs.HIDDEN.URL/jquery/jquery-1.6.4.min.js:3) >> at script(http://mrbs.HIDDEN.URL/jquery/jquery-1.6.4.min.js:2) >> at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpret(Interpreter.java:798) >> at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call(InterpretedFunction.java:105) >> at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.doTopCall(ContextFactory.java:411) >> at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.doTopCall(HtmlUnitContextFactory.java:309) >> at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3056) >> at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call(InterpretedFunction.java:103) >> at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$4.doRun(JavaScriptEngine.java:614) >> at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:674) >> at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:620) >> at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:513) >> at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:621) >> at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:596) >> at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptFunctionIfPossible(HtmlPage.java:990) >> at com.gargoylesoftware.htmlunit.javascript.host.EventListenersContainer.executeEventListeners(EventListenersContainer.java:179) >> at com.gargoylesoftware.htmlunit.javascript.host.EventListenersContainer.executeBubblingListeners(EventListenersContainer.java:239) >> at com.gargoylesoftware.htmlunit.javascript.host.Node.fireEvent(Node.java:837) >> at com.gargoylesoftware.htmlunit.javascript.host.Node.fireEvent(Node.java:761) >> at com.gargoylesoftware.htmlunit.html.HtmlElement$1.run(HtmlElement.java:915) >> at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:620) >> at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:513) >> at com.gargoylesoftware.htmlunit.html.HtmlElement.fireEvent(HtmlElement.java:920) >> at com.gargoylesoftware.htmlunit.html.HtmlPage.executeEventHandlersIfNeeded(HtmlPage.java:1287) >> at com.gargoylesoftware.htmlunit.html.HtmlPage.initialize(HtmlPage.java:279) >> at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:462) >> at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:329) >> at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:394) >> at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:379) >> at test1.mrbsPage(test1.java:28) >> at __SHELL1.run(__SHELL1.java:8) >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) >> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) >> at java.lang.reflect.Method.invoke(Method.java:606) >> at bluej.runtime.ExecServer$3.run(ExecServer.java:730) >> == CALLING JAVASCRIPT == >> >> function (a) { >> return typeof f != "undefined" && (!a || f.event.triggered !== a.type) ? f.event.handle.apply(k.elem, arguments) : b; >> } >> >> ======= EXCEPTION END ======== >> Exception occurred. >> > >Thanks for any hints. >Regards >Ralf > |
From: Ahmed A. <asa...@ya...> - 2014-02-06 16:52:53
|
Hi David, The change was done on core-js snapshot, not in HtmlUnit proper. Ahmed > On Feb 6, 2014, at 7:06 PM, David Michael Gang <mic...@gm...> wrote: > > Hi, > > I don't see the build. > The latest build at the site build.canoo.com/htmlunit/buildresults > was at "02/05/2014 21:25:25". > > Thanks, > David > > > >> On Thu, Feb 6, 2014 at 4:50 PM, <htm...@li...> wrote: >> Send Htmlunit-user mailing list submissions to >> htm...@li... >> >> To subscribe or unsubscribe via the World Wide Web, visit >> https://lists.sourceforge.net/lists/listinfo/htmlunit-user >> or, via email, send a message with subject or body 'help' to >> htm...@li... >> >> You can reach the person managing the list at >> htm...@li... >> >> When replying, please edit your Subject line so it is more specific >> than "Re: Contents of Htmlunit-user digest..." >> >> >> Today's Topics: >> >> 1. Re: htmlunit dies on page (Ahmed Ashour) >> 2. First obstacles, javascript exception for MRBS. (rg...@gm...) >> 3. Re: First obstacles, javascript exception for MRBS. (Ronald Brill) >> 4. Re: java.lang.ClassCastException: >> com.gargoylesoftware.htmlunit.TextPage cannot be cast to >> com.gargoylesoftware.htmlunit.html.HtmlPage (Ahmed Ashour) >> >> >> ---------------------------------------------------------------------- >> >> Message: 1 >> Date: Wed, 5 Feb 2014 07:37:16 -0800 (PST) >> From: Ahmed Ashour <asa...@ya...> >> Subject: Re: [Htmlunit-user] htmlunit dies on page >> To: "htm...@li..." >> <htm...@li...> >> Message-ID: >> <139...@we...> >> Content-Type: text/plain; charset="us-ascii" >> >> Fixed in snapshot. >> >> Ahmed >> >> ________________________________ >> From: Ahmed Ashour <asa...@ya...> >> To: "htm...@li..." <htm...@li...> >> Sent: Wednesday, February 5, 2014 5:12 PM >> Subject: Re: [Htmlunit-user] htmlunit dies on page >> >> >> >> Hi David, >> >> I confirm, this is an issue. >> >> Stay tuned. >> >> Ahmed > ------------------------------------------------------------------------------ > Managing the Performance of Cloud-Based Applications > Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. > Read the Whitepaper. > http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user |
From: David M. G. <mic...@gm...> - 2014-02-06 16:06:52
|
Hi, I don't see the build. The latest build at the site build.canoo.com/htmlunit/buildresults was at "02/05/2014 21:25:25". Thanks, David On Thu, Feb 6, 2014 at 4:50 PM, <htm...@li... > wrote: > Send Htmlunit-user mailing list submissions to > htm...@li... > > To subscribe or unsubscribe via the World Wide Web, visit > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > or, via email, send a message with subject or body 'help' to > htm...@li... > > You can reach the person managing the list at > htm...@li... > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Htmlunit-user digest..." > > > Today's Topics: > > 1. Re: htmlunit dies on page (Ahmed Ashour) > 2. First obstacles, javascript exception for MRBS. (rg...@gm...) > 3. Re: First obstacles, javascript exception for MRBS. (Ronald Brill) > 4. Re: java.lang.ClassCastException: > com.gargoylesoftware.htmlunit.TextPage cannot be cast to > com.gargoylesoftware.htmlunit.html.HtmlPage (Ahmed Ashour) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 5 Feb 2014 07:37:16 -0800 (PST) > From: Ahmed Ashour <asa...@ya...> > Subject: Re: [Htmlunit-user] htmlunit dies on page > To: "htm...@li..." > <htm...@li...> > Message-ID: > <139...@we...> > Content-Type: text/plain; charset="us-ascii" > > Fixed in snapshot. > > Ahmed > > ________________________________ > From: Ahmed Ashour <asa...@ya...> > To: "htm...@li..." < > htm...@li...> > Sent: Wednesday, February 5, 2014 5:12 PM > Subject: Re: [Htmlunit-user] htmlunit dies on page > > > > Hi David, > > I confirm, this is an issue. > > Stay tuned. > > Ahmed > |
From: <rg...@gm...> - 2014-02-06 15:47:57
|
Am 05.02.2014 21:55, schrieb Ronald Brill: >> >/usr/share/htmlunit-2.8.jar -- for WebSite and other classes. >> > > The current release version is 2.13 and 2.14 will be available shortly. > So start with the latest release or download the lastes snapshot from http://build.canoo.com/htmlunit/artifacts/. > > RBRi Dear Ronald, thanks for pointing this out. Now, I got the most recent version including all dependencies. I took a while until I managed to add missing libraries to the classpath list one by one, as I use quite a basic build environment called BlueJ. Is there a project file to start with, either for Eclipse or Netbeans? Now, these libs are listed user.libraries: > /home/me/JAVA/htmlunit-2.14-SNAPSHOT/lib/nekohtml-1.9.20-20140123.095453-1.jar > /home/me/JAVA/htmlunit-2.14-SNAPSHOT/lib/jetty-http-8.1.14.v20131031.jar > /home/me/JAVA/htmlunit-2.14-SNAPSHOT/lib/commons-io-2.4.jar > /home/me/JAVA/htmlunit-2.14-SNAPSHOT/lib/commons-codec-1.9.jar > /home/me/JAVA/htmlunit-2.14-SNAPSHOT/lib/sac-1.3.jar > /home/me/JAVA/htmlunit-2.14-SNAPSHOT/lib/jetty-io-8.1.14.v20131031.jar > /home/me/JAVA/htmlunit-2.14-SNAPSHOT/lib/commons-lang3-3.2.1.jar > /home/me/JAVA/htmlunit-2.14-SNAPSHOT/lib/htmlunit-core-js-2.14-20140203.084841-5.jar > /home/me/JAVA/htmlunit-2.14-SNAPSHOT/lib/httpclient-4.3.2.jar > /home/me/JAVA/htmlunit-2.14-SNAPSHOT/lib/serializer-2.7.1.jar > /home/me/JAVA/htmlunit-2.14-SNAPSHOT/lib/commons-collections-3.2.1.jar > /home/me/JAVA/htmlunit-2.14-SNAPSHOT/lib/commons-logging-1.1.3.jar > /home/me/JAVA/htmlunit-2.14-SNAPSHOT/lib/htmlunit-2.14-SNAPSHOT.jar > /home/me/JAVA/htmlunit-2.14-SNAPSHOT/lib/httpcore-4.3.1.jar > /home/me/JAVA/htmlunit-2.14-SNAPSHOT/lib/xalan-2.7.1.jar > /home/me/JAVA/htmlunit-2.14-SNAPSHOT/lib/cssparser-0.9.13.jar > /usr/share/java/junit4-4.11.jar > /home/me/JAVA/htmlunit-2.14-SNAPSHOT/lib/jetty-websocket-8.1.14.v20131031.jar > /home/me/JAVA/htmlunit-2.14-SNAPSHOT/lib/httpmime-4.3.2.jar > /home/me/JAVA/htmlunit-2.14-SNAPSHOT/lib/xercesImpl-2.11.0.jar > /home/me/JAVA/htmlunit-2.14-SNAPSHOT/lib/xml-apis-1.4.01.jar Now, my method returns again this exception (now running as FIREFOX_24) when calling final HtmlPage page = webClient.getPage("http://mrbs.HIDDEN.URL/admin.php"); There is an open demo server or mrbs, cf. http://mrbs.sourceforge.net/mrbs/admin.php (login admin/admin). (The exception occurs about after 7 seconds) A. Error Console Output > Feb 06, 2014 4:43:20 PM com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error > WARNING: CSS error: 'http://mrbs.HIDDEN.URL/jquery/datatables/css/mrbs-table.css' [88:3] Error in style rule. (Invalid token "*". Was expecting one of: <EOF>, <S>, <IDENT>, "}", ";".) > Feb 06, 2014 4:43:20 PM com.gargoylesoftware.htmlunit.DefaultCssErrorHandler warning > WARNING: CSS warning: 'http://mrbs.HIDDEN.URL/jquery/datatables/css/mrbs-table.css' [88:3] Ignoring the following declarations in this rule. > Feb 06, 2014 4:43:21 PM com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error > WARNING: CSS error: 'http://mrbs.HIDDEN.URL/jquery/datatables/css/mrbs-table.css' [262:3] Error in style rule. (Invalid token "*". Was expecting one of: <EOF>, <S>, <IDENT>, "}", ";".) > Feb 06, 2014 4:43:21 PM com.gargoylesoftware.htmlunit.DefaultCssErrorHandler warning > WARNING: CSS warning: 'http://mrbs.HIDDEN.URL/jquery/datatables/css/mrbs-table.css' [262:3] Ignoring the following declarations in this rule. > Feb 06, 2014 4:43:21 PM com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error > WARNING: CSS error: 'http://mrbs.HIDDEN.URL/jquery/datatables/css/mrbs-table.css' [323:3] Error in style rule. (Invalid token "*". Was expecting one of: <EOF>, <S>, <IDENT>, "}", ";".) > Feb 06, 2014 4:43:21 PM com.gargoylesoftware.htmlunit.DefaultCssErrorHandler warning > WARNING: CSS warning: 'http://mrbs.HIDDEN.URL/jquery/datatables/css/mrbs-table.css' [323:3] Ignoring the following declarations in this rule. > Feb 06, 2014 4:43:21 PM com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error > WARNING: CSS error: 'http://mrbs.HIDDEN.URL/jquery/datatables/css/ColVis.css' [19:2] Error in style rule. (Invalid token "*". Was expecting one of: <EOF>, <S>, <IDENT>, "}", ";".) > Feb 06, 2014 4:43:21 PM com.gargoylesoftware.htmlunit.DefaultCssErrorHandler warning > WARNING: CSS warning: 'http://mrbs.HIDDEN.URL/jquery/datatables/css/ColVis.css' [19:2] Ignoring the following declarations in this rule. > Feb 06, 2014 4:43:25 PM com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify > WARNING: Obsolete content type encountered: 'application/x-javascript'. > Feb 06, 2014 4:43:26 PM com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify > WARNING: Obsolete content type encountered: 'application/x-javascript'. > Feb 06, 2014 4:43:26 PM com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify > WARNING: Obsolete content type encountered: 'application/x-javascript'. > Feb 06, 2014 4:43:26 PM com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify > WARNING: Obsolete content type encountered: 'application/x-javascript'. > Feb 06, 2014 4:43:26 PM com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify > WARNING: Obsolete content type encountered: 'application/x-javascript'. > Feb 06, 2014 4:43:26 PM com.gargoylesoftware.htmlunit.html.InputElementFactory createElementNS > INFO: Bad input type: "search", creating a text input B. Console Output: > test11.mrbsPage(); > ======= EXCEPTION START ======== > EcmaError: lineNumber=[23] column=[0] lineSource=[null] name=[TypeError] sourceName=[http://mrbs.HIDDEN.URL/js/general.js.php?area=0] message=[TypeError: Cannot call method "indexOf" of undefined (http://mrbs.HIDDEN.URL/js/general.js.php?area=0#23)] > com.gargoylesoftware.htmlunit.ScriptException: TypeError: Cannot call method "indexOf" of undefined (http://mrbs.HIDDEN.URL/js/general.js.php?area=0#23) > at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:689) > at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:620) > at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:513) > at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:621) > at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:596) > at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptFunctionIfPossible(HtmlPage.java:990) > at com.gargoylesoftware.htmlunit.javascript.host.EventListenersContainer.executeEventListeners(EventListenersContainer.java:179) > at com.gargoylesoftware.htmlunit.javascript.host.EventListenersContainer.executeBubblingListeners(EventListenersContainer.java:239) > at com.gargoylesoftware.htmlunit.javascript.host.Node.fireEvent(Node.java:837) > at com.gargoylesoftware.htmlunit.javascript.host.Node.fireEvent(Node.java:761) > at com.gargoylesoftware.htmlunit.html.HtmlElement$1.run(HtmlElement.java:915) > at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:620) > at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:513) > at com.gargoylesoftware.htmlunit.html.HtmlElement.fireEvent(HtmlElement.java:920) > at com.gargoylesoftware.htmlunit.html.HtmlPage.executeEventHandlersIfNeeded(HtmlPage.java:1287) > at com.gargoylesoftware.htmlunit.html.HtmlPage.initialize(HtmlPage.java:279) > at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:462) > at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:329) > at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:394) > at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:379) > at test1.mrbsPage(test1.java:28) > Caused by: net.sourceforge.htmlunit.corejs.javascript.EcmaError: TypeError: Cannot call method "indexOf" of undefined (http://mrbs.HIDDEN.URL/js/general.js.php?area=0#23) > at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3628) > at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3612) > at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3633) > at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:3649) > at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.undefCallError(ScriptRuntime.java:3663) > at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.getPropFunctionAndThisHelper(ScriptRuntime.java:2220) > at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.getPropFunctionAndThis(ScriptRuntime.java:2214) > at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpretLoop(Interpreter.java:1333) > at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpret(Interpreter.java:798) > at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call(InterpretedFunction.java:105) > at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.doTopCall(ContextFactory.java:411) > at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.doTopCall(HtmlUnitContextFactory.java:309) > at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3056) > at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call(InterpretedFunction.java:103) > at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$4.doRun(JavaScriptEngine.java:614) > at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:674) > at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:620) > at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:513) > at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:621) > at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:596) > at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptFunctionIfPossible(HtmlPage.java:990) > at com.gargoylesoftware.htmlunit.javascript.host.EventListenersContainer.executeEventListeners(EventListenersContainer.java:179) > at com.gargoylesoftware.htmlunit.javascript.host.EventListenersContainer.executeBubblingListeners(EventListenersContainer.java:239) > at com.gargoylesoftware.htmlunit.javascript.host.Node.fireEvent(Node.java:837) > at com.gargoylesoftware.htmlunit.javascript.host.Node.fireEvent(Node.java:761) > at com.gargoylesoftware.htmlunit.html.HtmlElement$1.run(HtmlElement.java:915) > at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:620) > at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:513) > at com.gargoylesoftware.htmlunit.html.HtmlElement.fireEvent(HtmlElement.java:920) > at com.gargoylesoftware.htmlunit.html.HtmlPage.executeEventHandlersIfNeeded(HtmlPage.java:1287) > at com.gargoylesoftware.htmlunit.html.HtmlPage.initialize(HtmlPage.java:279) > at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:462) > at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:329) > at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:394) > at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:379) > at test1.mrbsPage(test1.java:28) > at __SHELL1.run(__SHELL1.java:8) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:606) > at bluej.runtime.ExecServer$3.run(ExecServer.java:730) > Enclosed exception: > net.sourceforge.htmlunit.corejs.javascript.EcmaError: TypeError: Cannot call method "indexOf" of undefined (http://mrbs.HIDDEN.URL/js/general.js.php?area=0#23) > at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3628) > at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3612) > at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3633) > at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:3649) > at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.undefCallError(ScriptRuntime.java:3663) > at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.getPropFunctionAndThisHelper(ScriptRuntime.java:2220) > at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.getPropFunctionAndThis(ScriptRuntime.java:2214) > at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpretLoop(Interpreter.java:1333) > at script(http://mrbs.HIDDEN.URL/js/general.js.php?area=0:23) > at script(script in http://mrbs.HIDDEN.URL/admin.php from (101, 32) to (123, 10):117) > at script(http://mrbs.HIDDEN.URL/jquery/jquery-1.6.4.min.js:3) > at script(http://mrbs.HIDDEN.URL/jquery/jquery-1.6.4.min.js:2) > at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpret(Interpreter.java:798) > at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call(InterpretedFunction.java:105) > at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.doTopCall(ContextFactory.java:411) > at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.doTopCall(HtmlUnitContextFactory.java:309) > at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3056) > at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call(InterpretedFunction.java:103) > at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$4.doRun(JavaScriptEngine.java:614) > at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:674) > at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:620) > at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:513) > at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:621) > at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:596) > at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptFunctionIfPossible(HtmlPage.java:990) > at com.gargoylesoftware.htmlunit.javascript.host.EventListenersContainer.executeEventListeners(EventListenersContainer.java:179) > at com.gargoylesoftware.htmlunit.javascript.host.EventListenersContainer.executeBubblingListeners(EventListenersContainer.java:239) > at com.gargoylesoftware.htmlunit.javascript.host.Node.fireEvent(Node.java:837) > at com.gargoylesoftware.htmlunit.javascript.host.Node.fireEvent(Node.java:761) > at com.gargoylesoftware.htmlunit.html.HtmlElement$1.run(HtmlElement.java:915) > at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:620) > at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:513) > at com.gargoylesoftware.htmlunit.html.HtmlElement.fireEvent(HtmlElement.java:920) > at com.gargoylesoftware.htmlunit.html.HtmlPage.executeEventHandlersIfNeeded(HtmlPage.java:1287) > at com.gargoylesoftware.htmlunit.html.HtmlPage.initialize(HtmlPage.java:279) > at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:462) > at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:329) > at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:394) > at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:379) > at test1.mrbsPage(test1.java:28) > at __SHELL1.run(__SHELL1.java:8) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:606) > at bluej.runtime.ExecServer$3.run(ExecServer.java:730) > == CALLING JAVASCRIPT == > > function (a) { > return typeof f != "undefined" && (!a || f.event.triggered !== a.type) ? f.event.handle.apply(k.elem, arguments) : b; > } > > ======= EXCEPTION END ======== > Exception occurred. > Thanks for any hints. Regards Ralf -- PGP/GnuPG: pub 1024D/E6DE0971 |
From: Ahmed A. <asa...@ya...> - 2014-02-06 14:50:22
|
Hi, IPhone user-agent is not part of the supported browser, if you change it to chrome, it would work. Please try to isolate a minimal test case in which HtmlUnit behaves different than real browsers. Ahmed ________________________________ From: Sreenath <sre...@gm...> To: "htm...@li..." <htm...@li...>; Ahmed Ashour <asa...@ya...> Cc: smk smk <ste...@gm...> Sent: Thursday, February 6, 2014 4:09 PM Subject: Re: [Htmlunit-user] java.lang.ClassCastException: com.gargoylesoftware.htmlunit.TextPage cannot be cast to com.gargoylesoftware.htmlunit.html.HtmlPage Hello, I am providing the code snippet to reproduce the scenario. ---------------------code starts here ------------------------- import java.io.IOException; import java.net.URL; import com.gargoylesoftware.htmlunit.BrowserVersion; import com.gargoylesoftware.htmlunit.CookieManager; import com.gargoylesoftware.htmlunit.HttpWebConnection; import com.gargoylesoftware.htmlunit.ScriptResult; import com.gargoylesoftware.htmlunit.WebClient; import com.gargoylesoftware.htmlunit.WebRequest; import com.gargoylesoftware.htmlunit.WebResponse; import com.gargoylesoftware.htmlunit.html.DomNode; import com.gargoylesoftware.htmlunit.html.DomNodeList; import com.gargoylesoftware.htmlunit.html.HtmlButton; import com.gargoylesoftware.htmlunit.html.HtmlElement; import com.gargoylesoftware.htmlunit.html.HtmlInput; import com.gargoylesoftware.htmlunit.html.HtmlOption; import com.gargoylesoftware.htmlunit.html.HtmlPage; import com.gargoylesoftware.htmlunit.html.HtmlRadioButtonInput; import com.gargoylesoftware.htmlunit.html.HtmlSelect; public class TestProgramm {public static void main(String args[]) { String url = ""; url = "http://www.victoriassecret.com/victorias-secret-sport/gear/eko-lite-yoga-mat-manduka?ProductID=77748&CatalogueType=OLS"; HtmlPage page = null; try { CookieManager cm = new CookieManager(); String USER_AGENT_IPHONE_4_2_1 = "Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_2_1 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8C148 Safari/6533.18.5"; BrowserVersion bvObj = BrowserVersion.FIREFOX_17; BrowserVersion bv = BrowserVersion.CHROME; bv.setUserAgent("Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_2_1 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8C148 Safari/6533.18.5"); bv.setOnLine(true); WebClient webClient = new WebClient(bv); webClient.setCookieManager(cm); |
From: Ronald B. <rb...@rb...> - 2014-02-05 20:55:53
|
> >/usr/share/htmlunit-2.8.jar -- for WebSite and other classes. > The current release version is 2.13 and 2.14 will be available shortly. So start with the latest release or download the lastes snapshot from http://build.canoo.com/htmlunit/artifacts/. RBRi |
From: <rg...@gm...> - 2014-02-05 20:45:07
|
Dear list users, the reason for joining this list is as follows: I am looking to fill in numerous bookings into our meeting room booking system (mrbs) that is hosted externally (otherwise it was easier to extend native php scripts). Those bookings are derived from our schedule, saved in a csv file. As I am a bit familiar with Java, I am confident to accomplish this mission by means of htmlunit. >From within Debian testing, I use these packages: libjenkins-htmlunit-java: Installed: 2.6-jenkins-6-1 libhtmlunit-java: Installed: 2.8-1 libjenkins-htmlunit-core-js-java: Installed: 2.6-hudson-1-1 passing these jar libraries to the javac compiler: /usr/share/junit-3.8.3.jar -- for assertions /usr/share/htmlunit-2.8.jar -- for WebSite and other classes. After importing needed classes (not stated on the "get started" section) like this: import com.gargoylesoftware.htmlunit.*; import com.gargoylesoftware.htmlunit.html.HtmlPage; import com.gargoylesoftware.htmlunit.BrowserVersion; import org.junit.Assert; the first example tests work as they should. However, when I just try to open the login page of our mrbs, I get nasty js errors, and I wonder ... - did I do any general mistakes? - did I use wrong libraries? - did anybody alread succeed with mrbs ? - why is the constant BrowserVersion.FIREFOX_17 reported to be unknown? public void mrbsPage() throws Exception { final WebClient webClient = new WebClient(BrowserVersion.getDefault()); final HtmlPage page = webClient.getPage("http://mrbs.HIDDEN.URL/admin.php"); ...} The output of console is quoted below. Thanks very much for any hints. Kind regards Ralf test11.mrbsPage(); ======= EXCEPTION START ======== EcmaError: lineNumber=[23] column=[0] lineSource=[null] name=[TypeError] sourceName=[http://mrbs.HIDDEN.URL/js/general.js.php?area=0] message=[TypeError: Cannot call method "indexOf" of undefined (http://mrbs.HIDDEN.URL/js/general.js.php?area=0#23)] com.gargoylesoftware.htmlunit.ScriptException: TypeError: Cannot call method "indexOf" of undefined (http://mrbs.HIDDEN.URL/js/general.js.php?area=0#23) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:601) at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:537) at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:538) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:531) at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptFunctionIfPossible(HtmlPage.java:906) at com.gargoylesoftware.htmlunit.javascript.host.EventListenersContainer.executeEventListeners(EventListenersContainer.java:164) at com.gargoylesoftware.htmlunit.javascript.host.EventListenersContainer.executeBubblingListeners(EventListenersContainer.java:223) at com.gargoylesoftware.htmlunit.javascript.host.Node.fireEvent(Node.java:696) at com.gargoylesoftware.htmlunit.html.HtmlElement$2.run(HtmlElement.java:885) at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:537) at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:538) at com.gargoylesoftware.htmlunit.html.HtmlElement.fireEvent(HtmlElement.java:890) at com.gargoylesoftware.htmlunit.html.HtmlPage.executeEventHandlersIfNeeded(HtmlPage.java:1156) at com.gargoylesoftware.htmlunit.html.HtmlPage.initialize(HtmlPage.java:212) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:436) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:307) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:369) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:354) at test1.mrbsPage(test1.java:28) Caused by: net.sourceforge.htmlunit.corejs.javascript.EcmaError: TypeError: Cannot call method "indexOf" of undefined (http://mrbs.HIDDEN.URL/js/general.js.php?area=0#23) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3772) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3750) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3778) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:3797) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.undefCallError(ScriptRuntime.java:3816) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.getPropFunctionAndThisHelper(ScriptRuntime.java:2320) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.getPropFunctionAndThis(ScriptRuntime.java:2313) at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpretLoop(Interpreter.java:1515) at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpret(Interpreter.java:845) at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call(InterpretedFunction.java:164) at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.doTopCall(ContextFactory.java:429) at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.doTopCall(HtmlUnitContextFactory.java:269) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3162) at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call(InterpretedFunction.java:162) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:559) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$4.doRun(JavaScriptEngine.java:524) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:595) at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:537) at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:538) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:531) at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptFunctionIfPossible(HtmlPage.java:906) at com.gargoylesoftware.htmlunit.javascript.host.EventListenersContainer.executeEventListeners(EventListenersContainer.java:164) at com.gargoylesoftware.htmlunit.javascript.host.EventListenersContainer.executeBubblingListeners(EventListenersContainer.java:223) at com.gargoylesoftware.htmlunit.javascript.host.Node.fireEvent(Node.java:696) at com.gargoylesoftware.htmlunit.html.HtmlElement$2.run(HtmlElement.java:885) at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:537) at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:538) at com.gargoylesoftware.htmlunit.html.HtmlElement.fireEvent(HtmlElement.java:890) at com.gargoylesoftware.htmlunit.html.HtmlPage.executeEventHandlersIfNeeded(HtmlPage.java:1156) at com.gargoylesoftware.htmlunit.html.HtmlPage.initialize(HtmlPage.java:212) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:436) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:307) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:369) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:354) at test1.mrbsPage(test1.java:28) at __SHELL10.run(__SHELL10.java:8) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at bluej.runtime.ExecServer$3.run(ExecServer.java:730) Enclosed exception: net.sourceforge.htmlunit.corejs.javascript.EcmaError: TypeError: Cannot call method "indexOf" of undefined (http://mrbs.HIDDEN.URL/js/general.js.php?area=0#23) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3772) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3750) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3778) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:3797) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.undefCallError(ScriptRuntime.java:3816) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.getPropFunctionAndThisHelper(ScriptRuntime.java:2320) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.getPropFunctionAndThis(ScriptRuntime.java:2313) at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpretLoop(Interpreter.java:1515) at script(http://mrbs.HIDDEN.URL/js/general.js.php?area=0:23) at script(script in http://mrbs.HIDDEN.URL/admin.php from (101, 32) to (123, 10):117) at script(http://mrbs.HIDDEN.URL/jquery/jquery-1.6.4.min.js:3) at script(http://mrbs.HIDDEN.URL/jquery/jquery-1.6.4.min.js:2) at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpret(Interpreter.java:845) at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call(InterpretedFunction.java:164) at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.doTopCall(ContextFactory.java:429) at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.doTopCall(HtmlUnitContextFactory.java:269) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3162) at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call(InterpretedFunction.java:162) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:559) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$4.doRun(JavaScriptEngine.java:524) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run( Exception occurred. JavaScriptEngine.java:595) at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:537) at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:538) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:531) at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptFunctionIfPossible(HtmlPage.java:906) at com.gargoylesoftware.htmlunit.javascript.host.EventListenersContainer.executeEventListeners(EventListenersContainer.java:164) at com.gargoylesoftware.htmlunit.javascript.host.EventListenersContainer.executeBubblingListeners(EventListenersContainer.java:223) at com.gargoylesoftware.htmlunit.javascript.host.Node.fireEvent(Node.java:696) at com.gargoylesoftware.htmlunit.html.HtmlElement$2.run(HtmlElement.java:885) at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:537) at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:538) at com.gargoylesoftware.htmlunit.html.HtmlElement.fireEvent(HtmlElement.java:890) at com.gargoylesoftware.htmlunit.html.HtmlPage.executeEventHandlersIfNeeded(HtmlPage.java:1156) at com.gargoylesoftware.htmlunit.html.HtmlPage.initialize(HtmlPage.java:212) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:436) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:307) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:369) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:354) at test1.mrbsPage(test1.java:28) at __SHELL10.run(__SHELL10.java:8) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at bluej.runtime.ExecServer$3.run(ExecServer.java:730) == CALLING JAVASCRIPT == function (a) { return typeof f != "undefined" && (!a || f.event.triggered !== a.type) ? f.event.handle.apply(k.elem, arguments) : b; } ======= EXCEPTION END ======== |
From: Ahmed A. <asa...@ya...> - 2014-02-05 15:37:26
|
Fixed in snapshot. Ahmed ________________________________ From: Ahmed Ashour <asa...@ya...> To: "htm...@li..." <htm...@li...> Sent: Wednesday, February 5, 2014 5:12 PM Subject: Re: [Htmlunit-user] htmlunit dies on page Hi David, I confirm, this is an issue. Stay tuned. Ahmed |
From: Ahmed A. <asa...@ya...> - 2014-02-05 14:12:49
|
Hi David, I confirm, this is an issue. Stay tuned. Ahmed ________________________________ From: David Michael Gang <mic...@gm...> To: htm...@li... Sent: Wednesday, February 5, 2014 4:45 PM Subject: Re: [Htmlunit-user] htmlunit dies on page Hi, Thanks a lot. Here is the file package test; import java.io.IOException; import java.net.MalformedURLException; import com.gargoylesoftware.htmlunit.BrowserVersion; import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException; import com.gargoylesoftware.htmlunit.ImmediateRefreshHandler; import com.gargoylesoftware.htmlunit.Page; import com.gargoylesoftware.htmlunit.WebClient; import com.gargoylesoftware.htmlunit.html.HtmlPage; public class Redalcyc { public static void main(String[] args) throws FailingHttpStatusCodeException, MalformedURLException, IOException { // TODO Auto-generated method stub String url = "http://www.redalyc.org/articulo.oa?id=35700204"; WebClient client = new WebClient(BrowserVersion.FIREFOX_24); final HtmlPage page = client.getPage(url); System.out.println(page.asText()); } } BR, David |
From: David M. G. <mic...@gm...> - 2014-02-05 13:45:38
|
Hi, Thanks a lot. Here is the file package test; import java.io.IOException; import java.net.MalformedURLException; import com.gargoylesoftware.htmlunit.BrowserVersion; import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException; import com.gargoylesoftware.htmlunit.ImmediateRefreshHandler; import com.gargoylesoftware.htmlunit.Page; import com.gargoylesoftware.htmlunit.WebClient; import com.gargoylesoftware.htmlunit.html.HtmlPage; public class Redalcyc { public static void main(String[] args) throws FailingHttpStatusCodeException, MalformedURLException, IOException { // TODO Auto-generated method stub String url = "http://www.redalyc.org/articulo.oa?id=35700204"; WebClient client = new WebClient(BrowserVersion.FIREFOX_24); final HtmlPage page = client.getPage(url); System.out.println(page.asText()); } } BR, David > Message: 2 > Date: Wed, 5 Feb 2014 05:26:57 -0800 (PST) > From: Ahmed Ashour <asa...@ya...> > Subject: Re: [Htmlunit-user] htmlunit dies on page > To: "htm...@li..." > <htm...@li...> > Message-ID: > <139...@we...> > Content-Type: text/plain; charset="iso-8859-1" > > Hi David, > > Please send your a sample project/page that gives that error. > > Ahmed > > ________________________________ > From: David Michael Gang <mic...@gm...> > To: htm...@li... > Sent: Wednesday, February 5, 2014 3:39 PM > Subject: Re: [Htmlunit-user] htmlunit dies on page > > > > Hi, > > I deleted the maven repository and updated all dependencies again and > still get the error: > 05/02/2014 14:37:02 > com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify > WARNING: Obsolete content type encountered: 'text/javascript'. > 05/02/2014 14:37:13 > com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify > WARNING: Obsolete content type encountered: 'text/javascript'. > 05/02/2014 14:37:14 > com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify > WARNING: Obsolete content type encountered: 'application/x-javascript'. > Exception in thread "main" ======= EXCEPTION START ======== > Exception class=[java.lang.NullPointerException] > com.gargoylesoftware.htmlunit.ScriptException > ??? at > com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:689) > ??? at > net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:620) > ??? at > net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:513) > ??? at > com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:575) > ??? at > com.gargoylesoftware.htmlunit.html.HtmlPage.loadExternalJavaScriptFile(HtmlPage.java:1067) > ??? at > com.gargoylesoftware.htmlunit.html.HtmlScript.executeScriptIfNeeded(HtmlScript.java:391) > ??? at > com.gargoylesoftware.htmlunit.html.HtmlScript$3.execute(HtmlScript.java:272) > ??? at > com.gargoylesoftware.htmlunit.html.HtmlScript.onAllChildrenAddedToPage(HtmlScript.java:286) > ??? at > com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:702) > ??? at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown > Source) > ??? at > com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:662) > ??? at > org.cyberneko.html.HTMLTagBalancer.callEndElement(HTMLTagBalancer.java:1170) > ??? at > org.cyberneko.html.HTMLTagBalancer.endElement(HTMLTagBalancer.java:1072) > ??? at > org.cyberneko.html.filters.DefaultFilter.endElement(DefaultFilter.java:206) > ??? at > org.cyberneko.html.filters.NamespaceBinder.endElement(NamespaceBinder.java:330) > ??? at > org.cyberneko.html.HTMLScanner$ContentScanner.scanEndElement(HTMLScanner.java:3126) > ??? at > org.cyberneko.html.HTMLScanner$ContentScanner.scan(HTMLScanner.java:2093) > ??? at org.cyberneko.html.HTMLScanner.scanDocument(HTMLScanner.java:920) > ??? at > org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:499) > ??? at > org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:452) > ??? at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) > ??? at > com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.parse(HTMLParser.java:926) > ??? at > com.gargoylesoftware.htmlunit.html.HTMLParser.parse(HTMLParser.java:245) > ??? at > com.gargoylesoftware.htmlunit.html.HTMLParser.parseHtml(HTMLParser.java:191) > ??? at > com.gargoylesoftware.htmlunit.DefaultPageCreator.createHtmlPage(DefaultPageCreator.java:268) > ??? at > com.gargoylesoftware.htmlunit.DefaultPageCreator.createPage(DefaultPageCreator.java:156) > ??? at > com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:455) > ??? at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:329) > ??? at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:394) > ??? at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:379) > ??? at test.Redalcyc.main(Redalcyc.java:19) > Caused by: java.lang.NullPointerException > ??? at > net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.enumChangeObject(ScriptRuntime.java:2106) > ??? at > net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.enumNext(ScriptRuntime.java:2022) > ??? at > net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpretLoop(Interpreter.java:1739) > ??? at > net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpret(Interpreter.java:798) > ??? at > net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call(InterpretedFunction.java:105) > ??? at > net.sourceforge.htmlunit.corejs.javascript.ContextFactory.doTopCall(ContextFactory.java:411) > ??? at > com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.doTopCall(HtmlUnitContextFactory.java:309) > ??? at > net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3056) > ??? at > net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.exec(InterpretedFunction.java:115) > ??? at > com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$3.doRun(JavaScriptEngine.java:566) > ??? at > com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:674) > ??? ... 30 more > Enclosed exception: > java.lang.NullPointerException > ??? at > net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.enumChangeObject(ScriptRuntime.java:2106) > ??? at > net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.enumNext(ScriptRuntime.java:2022) > ??? at > net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpretLoop(Interpreter.java:1739) > ??? at > net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpret(Interpreter.java:798) > ??? at > net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call(InterpretedFunction.java:105) > ??? at > net.sourceforge.htmlunit.corejs.javascript.ContextFactory.doTopCall(ContextFactory.java:411) > ??? at > com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.doTopCall(HtmlUnitContextFactory.java:309) > ??? at > net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3056) > ??? at > net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.exec(InterpretedFunction.java:115) > ??? at > com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$3.doRun(JavaScriptEngine.java:566) > ??? at > com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:674) > ??? at > net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:620) > ??? at > net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:513) > ??? at > com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:575) > ??? at > com.gargoylesoftware.htmlunit.html.HtmlPage.loadExternalJavaScriptFile(HtmlPage.java:1067) > ??? at > com.gargoylesoftware.htmlunit.html.HtmlScript.executeScriptIfNeeded(HtmlScript.java:391) > ??? at > com.gargoylesoftware.htmlunit.html.HtmlScript$3.execute(HtmlScript.java:272) > ??? at > com.gargoylesoftware.htmlunit.html.HtmlScript.onAllChildrenAddedToPage(HtmlScript.java:286) > ??? at > com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:702) > ??? at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown > Source) > ??? at > com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:662) > ??? at > org.cyberneko.html.HTMLTagBalancer.callEndElement(HTMLTagBalancer.java:1170) > ??? at > org.cyberneko.html.HTMLTagBalancer.endElement(HTMLTagBalancer.java:1072) > ??? at > org.cyberneko.html.filters.DefaultFilter.endElement(DefaultFilter.java:206) > ??? at > org.cyberneko.html.filters.NamespaceBinder.endElement(NamespaceBinder.java:330) > ??? at > org.cyberneko.html.HTMLScanner$ContentScanner.scanEndElement(HTMLScanner.java:3126) > ??? at > org.cyberneko.html.HTMLScanner$ContentScanner.scan(HTMLScanner.java:2093) > ??? at org.cyberneko.html.HTMLScanner.scanDocument(HTMLScanner.java:920) > ??? at > org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:499) > ??? at > org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:452) > ??? at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) > ??? at > com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.parse(HTMLParser.java:926) > ??? at > com.gargoylesoftware.htmlunit.html.HTMLParser.parse(HTMLParser.java:245) > ??? at > com.gargoylesoftware.htmlunit.html.HTMLParser.parseHtml(HTMLParser.java:191) > ??? at > com.gargoylesoftware.htmlunit.DefaultPageCreator.createHtmlPage(DefaultPageCreator.java:268) > ??? at > com.gargoylesoftware.htmlunit.DefaultPageCreator.createPage(DefaultPageCreator.java:156) > ??? at > com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:455) > ??? at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:329) > ??? at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:394) > ??? at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:379) > ??? at test.Redalcyc.main(Redalcyc.java:19) > ======= EXCEPTION END ======== > > What can i check next? > > Thanks, > David > -------------- next part -------------- > An HTML attachment was scrubbed... > > ------------------------------ > > > ------------------------------------------------------------------------------ > Managing the Performance of Cloud-Based Applications > Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. > Read the Whitepaper. > > http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk > > ------------------------------ > > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > > > End of Htmlunit-user Digest, Vol 93, Issue 10 > ********************************************* > |
From: Ahmed A. <asa...@ya...> - 2014-02-05 13:27:04
|
Hi David, Please send your a sample project/page that gives that error. Ahmed ________________________________ From: David Michael Gang <mic...@gm...> To: htm...@li... Sent: Wednesday, February 5, 2014 3:39 PM Subject: Re: [Htmlunit-user] htmlunit dies on page Hi, I deleted the maven repository and updated all dependencies again and still get the error: 05/02/2014 14:37:02 com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify WARNING: Obsolete content type encountered: 'text/javascript'. 05/02/2014 14:37:13 com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify WARNING: Obsolete content type encountered: 'text/javascript'. 05/02/2014 14:37:14 com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify WARNING: Obsolete content type encountered: 'application/x-javascript'. Exception in thread "main" ======= EXCEPTION START ======== Exception class=[java.lang.NullPointerException] com.gargoylesoftware.htmlunit.ScriptException at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:689) at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:620) at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:513) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:575) at com.gargoylesoftware.htmlunit.html.HtmlPage.loadExternalJavaScriptFile(HtmlPage.java:1067) at com.gargoylesoftware.htmlunit.html.HtmlScript.executeScriptIfNeeded(HtmlScript.java:391) at com.gargoylesoftware.htmlunit.html.HtmlScript$3.execute(HtmlScript.java:272) at com.gargoylesoftware.htmlunit.html.HtmlScript.onAllChildrenAddedToPage(HtmlScript.java:286) at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:702) at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source) at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:662) at org.cyberneko.html.HTMLTagBalancer.callEndElement(HTMLTagBalancer.java:1170) at org.cyberneko.html.HTMLTagBalancer.endElement(HTMLTagBalancer.java:1072) at org.cyberneko.html.filters.DefaultFilter.endElement(DefaultFilter.java:206) at org.cyberneko.html.filters.NamespaceBinder.endElement(NamespaceBinder.java:330) at org.cyberneko.html.HTMLScanner$ContentScanner.scanEndElement(HTMLScanner.java:3126) at org.cyberneko.html.HTMLScanner$ContentScanner.scan(HTMLScanner.java:2093) at org.cyberneko.html.HTMLScanner.scanDocument(HTMLScanner.java:920) at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:499) at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:452) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.parse(HTMLParser.java:926) at com.gargoylesoftware.htmlunit.html.HTMLParser.parse(HTMLParser.java:245) at com.gargoylesoftware.htmlunit.html.HTMLParser.parseHtml(HTMLParser.java:191) at com.gargoylesoftware.htmlunit.DefaultPageCreator.createHtmlPage(DefaultPageCreator.java:268) at com.gargoylesoftware.htmlunit.DefaultPageCreator.createPage(DefaultPageCreator.java:156) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:455) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:329) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:394) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:379) at test.Redalcyc.main(Redalcyc.java:19) Caused by: java.lang.NullPointerException at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.enumChangeObject(ScriptRuntime.java:2106) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.enumNext(ScriptRuntime.java:2022) at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpretLoop(Interpreter.java:1739) at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpret(Interpreter.java:798) at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call(InterpretedFunction.java:105) at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.doTopCall(ContextFactory.java:411) at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.doTopCall(HtmlUnitContextFactory.java:309) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3056) at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.exec(InterpretedFunction.java:115) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$3.doRun(JavaScriptEngine.java:566) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:674) ... 30 more Enclosed exception: java.lang.NullPointerException at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.enumChangeObject(ScriptRuntime.java:2106) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.enumNext(ScriptRuntime.java:2022) at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpretLoop(Interpreter.java:1739) at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpret(Interpreter.java:798) at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call(InterpretedFunction.java:105) at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.doTopCall(ContextFactory.java:411) at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.doTopCall(HtmlUnitContextFactory.java:309) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3056) at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.exec(InterpretedFunction.java:115) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$3.doRun(JavaScriptEngine.java:566) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:674) at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:620) at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:513) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:575) at com.gargoylesoftware.htmlunit.html.HtmlPage.loadExternalJavaScriptFile(HtmlPage.java:1067) at com.gargoylesoftware.htmlunit.html.HtmlScript.executeScriptIfNeeded(HtmlScript.java:391) at com.gargoylesoftware.htmlunit.html.HtmlScript$3.execute(HtmlScript.java:272) at com.gargoylesoftware.htmlunit.html.HtmlScript.onAllChildrenAddedToPage(HtmlScript.java:286) at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:702) at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source) at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:662) at org.cyberneko.html.HTMLTagBalancer.callEndElement(HTMLTagBalancer.java:1170) at org.cyberneko.html.HTMLTagBalancer.endElement(HTMLTagBalancer.java:1072) at org.cyberneko.html.filters.DefaultFilter.endElement(DefaultFilter.java:206) at org.cyberneko.html.filters.NamespaceBinder.endElement(NamespaceBinder.java:330) at org.cyberneko.html.HTMLScanner$ContentScanner.scanEndElement(HTMLScanner.java:3126) at org.cyberneko.html.HTMLScanner$ContentScanner.scan(HTMLScanner.java:2093) at org.cyberneko.html.HTMLScanner.scanDocument(HTMLScanner.java:920) at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:499) at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:452) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.parse(HTMLParser.java:926) at com.gargoylesoftware.htmlunit.html.HTMLParser.parse(HTMLParser.java:245) at com.gargoylesoftware.htmlunit.html.HTMLParser.parseHtml(HTMLParser.java:191) at com.gargoylesoftware.htmlunit.DefaultPageCreator.createHtmlPage(DefaultPageCreator.java:268) at com.gargoylesoftware.htmlunit.DefaultPageCreator.createPage(DefaultPageCreator.java:156) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:455) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:329) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:394) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:379) at test.Redalcyc.main(Redalcyc.java:19) ======= EXCEPTION END ======== What can i check next? Thanks, David |
From: David M. G. <mic...@gm...> - 2014-02-05 12:39:49
|
Hi, I deleted the maven repository and updated all dependencies again and still get the error: 05/02/2014 14:37:02 com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify WARNING: Obsolete content type encountered: 'text/javascript'. 05/02/2014 14:37:13 com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify WARNING: Obsolete content type encountered: 'text/javascript'. 05/02/2014 14:37:14 com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify WARNING: Obsolete content type encountered: 'application/x-javascript'. Exception in thread "main" ======= EXCEPTION START ======== Exception class=[java.lang.NullPointerException] com.gargoylesoftware.htmlunit.ScriptException at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:689) at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:620) at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:513) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:575) at com.gargoylesoftware.htmlunit.html.HtmlPage.loadExternalJavaScriptFile(HtmlPage.java:1067) at com.gargoylesoftware.htmlunit.html.HtmlScript.executeScriptIfNeeded(HtmlScript.java:391) at com.gargoylesoftware.htmlunit.html.HtmlScript$3.execute(HtmlScript.java:272) at com.gargoylesoftware.htmlunit.html.HtmlScript.onAllChildrenAddedToPage(HtmlScript.java:286) at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:702) at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source) at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:662) at org.cyberneko.html.HTMLTagBalancer.callEndElement(HTMLTagBalancer.java:1170) at org.cyberneko.html.HTMLTagBalancer.endElement(HTMLTagBalancer.java:1072) at org.cyberneko.html.filters.DefaultFilter.endElement(DefaultFilter.java:206) at org.cyberneko.html.filters.NamespaceBinder.endElement(NamespaceBinder.java:330) at org.cyberneko.html.HTMLScanner$ContentScanner.scanEndElement(HTMLScanner.java:3126) at org.cyberneko.html.HTMLScanner$ContentScanner.scan(HTMLScanner.java:2093) at org.cyberneko.html.HTMLScanner.scanDocument(HTMLScanner.java:920) at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:499) at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:452) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.parse(HTMLParser.java:926) at com.gargoylesoftware.htmlunit.html.HTMLParser.parse(HTMLParser.java:245) at com.gargoylesoftware.htmlunit.html.HTMLParser.parseHtml(HTMLParser.java:191) at com.gargoylesoftware.htmlunit.DefaultPageCreator.createHtmlPage(DefaultPageCreator.java:268) at com.gargoylesoftware.htmlunit.DefaultPageCreator.createPage(DefaultPageCreator.java:156) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:455) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:329) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:394) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:379) at test.Redalcyc.main(Redalcyc.java:19) Caused by: java.lang.NullPointerException at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.enumChangeObject(ScriptRuntime.java:2106) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.enumNext(ScriptRuntime.java:2022) at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpretLoop(Interpreter.java:1739) at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpret(Interpreter.java:798) at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call(InterpretedFunction.java:105) at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.doTopCall(ContextFactory.java:411) at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.doTopCall(HtmlUnitContextFactory.java:309) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3056) at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.exec(InterpretedFunction.java:115) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$3.doRun(JavaScriptEngine.java:566) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:674) ... 30 more Enclosed exception: java.lang.NullPointerException at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.enumChangeObject(ScriptRuntime.java:2106) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.enumNext(ScriptRuntime.java:2022) at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpretLoop(Interpreter.java:1739) at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpret(Interpreter.java:798) at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call(InterpretedFunction.java:105) at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.doTopCall(ContextFactory.java:411) at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.doTopCall(HtmlUnitContextFactory.java:309) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3056) at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.exec(InterpretedFunction.java:115) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$3.doRun(JavaScriptEngine.java:566) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:674) at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:620) at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:513) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:575) at com.gargoylesoftware.htmlunit.html.HtmlPage.loadExternalJavaScriptFile(HtmlPage.java:1067) at com.gargoylesoftware.htmlunit.html.HtmlScript.executeScriptIfNeeded(HtmlScript.java:391) at com.gargoylesoftware.htmlunit.html.HtmlScript$3.execute(HtmlScript.java:272) at com.gargoylesoftware.htmlunit.html.HtmlScript.onAllChildrenAddedToPage(HtmlScript.java:286) at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:702) at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source) at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:662) at org.cyberneko.html.HTMLTagBalancer.callEndElement(HTMLTagBalancer.java:1170) at org.cyberneko.html.HTMLTagBalancer.endElement(HTMLTagBalancer.java:1072) at org.cyberneko.html.filters.DefaultFilter.endElement(DefaultFilter.java:206) at org.cyberneko.html.filters.NamespaceBinder.endElement(NamespaceBinder.java:330) at org.cyberneko.html.HTMLScanner$ContentScanner.scanEndElement(HTMLScanner.java:3126) at org.cyberneko.html.HTMLScanner$ContentScanner.scan(HTMLScanner.java:2093) at org.cyberneko.html.HTMLScanner.scanDocument(HTMLScanner.java:920) at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:499) at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:452) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.parse(HTMLParser.java:926) at com.gargoylesoftware.htmlunit.html.HTMLParser.parse(HTMLParser.java:245) at com.gargoylesoftware.htmlunit.html.HTMLParser.parseHtml(HTMLParser.java:191) at com.gargoylesoftware.htmlunit.DefaultPageCreator.createHtmlPage(DefaultPageCreator.java:268) at com.gargoylesoftware.htmlunit.DefaultPageCreator.createPage(DefaultPageCreator.java:156) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:455) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:329) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:394) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:379) at test.Redalcyc.main(Redalcyc.java:19) ======= EXCEPTION END ======== What can i check next? Thanks, David On Wed, Feb 5, 2014 at 11:19 AM, < htm...@li...> wrote: > Send Htmlunit-user mailing list submissions to > htm...@li... > > To subscribe or unsubscribe via the World Wide Web, visit > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > or, via email, send a message with subject or body 'help' to > htm...@li... > > You can reach the person managing the list at > htm...@li... > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Htmlunit-user digest..." > > > Today's Topics: > > 1. Re: htmlunit dies on page (Ahmed Ashour) > 2. Re: Map <bject> to custom JavaClass (asashour) > 3. java.lang.ClassCastException: > com.gargoylesoftware.htmlunit.TextPage cannot be cast to > com.gargoylesoftware.htmlunit.html.HtmlPage (Sreenath) > 4. Re: java.lang.ClassCastException: > com.gargoylesoftware.htmlunit.TextPage cannot be cast to > com.gargoylesoftware.htmlunit.html.HtmlPage (Ahmed Ashour) > 5. Re: java.lang.ClassCastException: > com.gargoylesoftware.htmlunit.TextPage cannot be cast to > com.gargoylesoftware.htmlunit.html.HtmlPage (smk smk) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Mon, 3 Feb 2014 08:00:03 -0800 (PST) > From: Ahmed Ashour <asa...@ya...> > Subject: Re: [Htmlunit-user] htmlunit dies on page > To: "htm...@li..." > <htm...@li...> > Message-ID: > <139...@we...> > Content-Type: text/plain; charset="us-ascii" > > Hi David, > > Please remove ~/.m2/repository and try again. > > Ahmed > > ________________________________ > From: David Michael Gang <mic...@gm...> > To: htm...@li... > Sent: Monday, February 3, 2014 6:15 PM > Subject: Re: [Htmlunit-user] htmlunit dies on page > > > > Hi, > > I still get these errors. > I use the latest snapshot from maven. > > Thanks, > David > -------------- next part -------------- > An HTML attachment was scrubbed... > > ------------------------------ > > |
From: Sreenadh VP <sre...@co...> - 2014-02-05 11:15:33
|
Thanks you so much for advising. As its navigational flow , need to do query selector for for getting element to click or inputting the values. If we assigned to type of TextPage or Page , not able to do query selector with methods "page.querySelectorAll", for same we need type HtmlPage at the end in the navigational clicks or submission. Sreenadh On Wed, Feb 5, 2014 at 3:41 PM, smk smk <ste...@gm...> wrote: > Change this "TextPage = responseAfterClick = elementTocick.click();" > > To this "TextPage responseAfterClick = elementTocick.click();" > > > 2014-02-05 smk smk <ste...@gm...>: > > Hi >> >> The problem is that you initialize the page as HtmlPage and not as Page. >> >> Thus you should do >> >> *Page* page = webClient.getPage(request); //not HtmlPage >> >> and then after the click you can do the check of the response as >> mentioned at the first response. >> >> page = elementTocick.click(); >> >> if(page instanceof TextPage) >> ......... >> else if( >> ...... >> >> My opinion though is to assign a new Page object at the response after >> the click >> >> e.g >> >> Page responseAfterClick = elementTocick.click(); >> if(responseAfterClick instanceof TextPage) >> ....... >> else if ( >> ....... >> >> and if you are sure that it always rerurns a TextPage then you can >> initialize it as TextPage from the beginning >> >> TextPage = responseAfterClick = elementTocick.click(); >> >> Hope that helps >> >> Stergios >> >> >> >> 2014-02-05 Sreenadh VP <sre...@co...>: >> >> Hi, >>> >>> Thanks for your attention and response. >>> >>> I have following code >>> >>> WebRequest request = new WebRequest(new URL(Url)); >>> >>> HtmlPage page = webClient.getPage(request); >>> >>> HtmlButton elementTocick = (HtmlButton)page.getElementById("elementId"); >>> >>> page = elementTocick.click(); // fails with >>> java.lang.ClassCastException: com.gargoylesoftware.htmlunit.TextPage cannot >>> be cast to com.gargoylesoftware.htmlunit.html.HtmlPage >>> >>> Need to assign new page after click to* page* reference of type >>> HtmlPage, how can do the the same? Please advice >>> >>> Sreenadh >>> >>> >>> On Wed, Feb 5, 2014 at 2:49 PM, smk smk <ste...@gm...> wrote: >>> >>>> Hi >>>> >>>> As Sreenadh mentioned not every response is an HtmlPage object however >>>> all of them are Page objects. Thus you have to typecast accordingly. >>>> >>>> Check the following code wchich returns the source as String according >>>> to the type of the response. >>>> >>>> Page pageSource = webClient.getPage("http://example.com"); >>>> String pageSourceString = getPageSource(pageSource); >>>> >>>> public static String getPageSource(Page page) >>>> { >>>> if(page instanceof HtmlPage) >>>> { >>>> return ((HtmlPage)page).asXml(); >>>> } >>>> else if(page instanceof JavaScriptPage) >>>> { >>>> return ((JavaScriptPage)page).getContent(); >>>> } >>>> else if(page instanceof TextPage) >>>> { >>>> return ((TextPage)page).getContent(); >>>> } >>>> else //page instanceof UnexpectedPage >>>> { >>>> return ((UnexpectedPage)page).getWebResponse().getContentAsString(); >>>> } >>>> } >>>> >>>> From the above example you can see that there are 4 different types of >>>> Pages that webClient returns. >>>> >>>> The method used here returns the string of the source however you can >>>> modify the code to your needs according to the instance is returned. >>>> >>>> Stergios >>>> >>>> >>>> >>>> >>>> >>>> 2014-02-05 Ahmed Ashour <asa...@ya...>: >>>> >>>>> Hi, >>>>> >>>>> This happens when HtmlUnit determines the content type of this page to >>>>> be plain text, not HTML. >>>>> >>>>> Please send the details of the complete case. >>>>> >>>>> Ahmed >>>>> ------------------------------ >>>>> *From:* Sreenath <sre...@gm...> >>>>> *To:* "htm...@li..." < >>>>> htm...@li...> >>>>> *Sent:* Wednesday, February 5, 2014 11:53 AM >>>>> *Subject:* [Htmlunit-user] java.lang.ClassCastException: >>>>> com.gargoylesoftware.htmlunit.TextPage cannot be cast to >>>>> com.gargoylesoftware.htmlunit.html.HtmlPage >>>>> >>>>> Hello, >>>>> >>>>> I have tried to load pme web page url and did submission of the page, >>>>> second page is not getting loaded due to following issue. >>>>> >>>>> >>>>> java.lang.ClassCastException: com.gargoylesoftware.htmlunit.TextPage >>>>> cannot be cast to com.gargoylesoftware.htmlunit.html.HtmlPage >>>>> >>>>> Note: my page is type of HtmlPage, not able to cast to HtmlPage >>>>> >>>>> Please advice why the second page is coming as type of >>>>> com.gargoylesoftware.htmlunit.TextPage, and how can assign to HtmlPage >>>>> type the same. >>>>> >>>>> Thanks in Advance >>>>> Sreenadh >>>>> >>>>> >>>>> >>>>> ------------------------------------------------------------------------------ >>>>> Managing the Performance of Cloud-Based Applications >>>>> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. >>>>> Read the Whitepaper. >>>>> >>>>> http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk >>>>> _______________________________________________ >>>>> Htmlunit-user mailing list >>>>> Htm...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/htmlunit-user >>>>> >>>>> >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> Managing the Performance of Cloud-Based Applications >>>> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. >>>> Read the Whitepaper. >>>> >>>> http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk >>>> _______________________________________________ >>>> Htmlunit-user mailing list >>>> Htm...@li... >>>> https://lists.sourceforge.net/lists/listinfo/htmlunit-user >>>> >>>> >>> >> > |
From: smk s. <ste...@gm...> - 2014-02-05 11:00:03
|
Additionally what is the source code of the page that opens after the click? Can you provide also the url? Is it possible that after the click you are redirected to a .txt page? If yes then query selector cannot be applied at all. It has no meaning to text files. Stergios 2014-02-05 Ahmed Ashour <asa...@ya...>: > Hi, > > TextPage doesn't process HTML/JavaScript/DOM/etc. TextPage is just plain > text. > > And since you are expecting it to be HtmlPage, where you can .click()/find > element/querySelector()/etc, you need to provide the actual page, so we > compare the content type and see how HtmlUnit handles it comparing to real > browsers. > > Ahmed > ------------------------------ > *From:* Sreenadh VP <sre...@co...> > *To:* smk smk <ste...@gm...> > *Cc:* htm...@li...; Ahmed Ashour < > asa...@ya...> > *Sent:* Wednesday, February 5, 2014 1:50 PM > *Subject:* Re: [Htmlunit-user] java.lang.ClassCastException: > com.gargoylesoftware.htmlunit.TextPage cannot be cast to > com.gargoylesoftware.htmlunit.html.HtmlPage > > hanks you so much for advising. > > As its navigational flow , need to do query selector for for getting > element to click or inputting the values. > > If we assigned to type of TextPage or Page , not able to do query selector > with methods "page.querySelectorAll", for same we need type HtmlPage at the > end in the navigational clicks or submission. How can we achieve this, > please advice. > > Sreenadh > > > |
From: Ahmed A. <asa...@ya...> - 2014-02-05 10:54:51
|
Hi, TextPage doesn't process HTML/JavaScript/DOM/etc. TextPage is just plain text. And since you are expecting it to be HtmlPage, where you can .click()/find element/querySelector()/etc, you need to provide the actual page, so we compare the content type and see how HtmlUnit handles it comparing to real browsers. Ahmed ________________________________ From: Sreenadh VP <sre...@co...> To: smk smk <ste...@gm...> Cc: htm...@li...; Ahmed Ashour <asa...@ya...> Sent: Wednesday, February 5, 2014 1:50 PM Subject: Re: [Htmlunit-user] java.lang.ClassCastException: com.gargoylesoftware.htmlunit.TextPage cannot be cast to com.gargoylesoftware.htmlunit.html.HtmlPage hanks you so much for advising. As its navigational flow , need to do query selector for for getting element to click or inputting the values. If we assigned to type of TextPage or Page , not able to do query selector with methods "page.querySelectorAll", for same we need type HtmlPage at the end in the navigational clicks or submission. How can we achieve this, please advice. Sreenadh |
From: Sreenadh VP <sre...@co...> - 2014-02-05 10:50:50
|
hanks you so much for advising. As its navigational flow , need to do query selector for for getting element to click or inputting the values. If we assigned to type of TextPage or Page , not able to do query selector with methods "page.querySelectorAll", for same we need type HtmlPage at the end in the navigational clicks or submission. How can we achieve this, please advice. Sreenadh On Wed, Feb 5, 2014 at 3:41 PM, smk smk <ste...@gm...> wrote: > Change this "TextPage = responseAfterClick = elementTocick.click();" > > To this "TextPage responseAfterClick = elementTocick.click();" > > > 2014-02-05 smk smk <ste...@gm...>: > > Hi >> >> The problem is that you initialize the page as HtmlPage and not as Page. >> >> Thus you should do >> >> *Page* page = webClient.getPage(request); //not HtmlPage >> >> and then after the click you can do the check of the response as >> mentioned at the first response. >> >> page = elementTocick.click(); >> >> if(page instanceof TextPage) >> ......... >> else if( >> ...... >> >> My opinion though is to assign a new Page object at the response after >> the click >> >> e.g >> >> Page responseAfterClick = elementTocick.click(); >> if(responseAfterClick instanceof TextPage) >> ....... >> else if ( >> ....... >> >> and if you are sure that it always rerurns a TextPage then you can >> initialize it as TextPage from the beginning >> >> TextPage = responseAfterClick = elementTocick.click(); >> >> Hope that helps >> >> Stergios >> >> >> >> 2014-02-05 Sreenadh VP <sre...@co...>: >> >> Hi, >>> >>> Thanks for your attention and response. >>> >>> I have following code >>> >>> WebRequest request = new WebRequest(new URL(Url)); >>> >>> HtmlPage page = webClient.getPage(request); >>> >>> HtmlButton elementTocick = (HtmlButton)page.getElementById("elementId"); >>> >>> page = elementTocick.click(); // fails with >>> java.lang.ClassCastException: com.gargoylesoftware.htmlunit.TextPage cannot >>> be cast to com.gargoylesoftware.htmlunit.html.HtmlPage >>> >>> Need to assign new page after click to* page* reference of type >>> HtmlPage, how can do the the same? Please advice >>> >>> Sreenadh >>> >>> >>> On Wed, Feb 5, 2014 at 2:49 PM, smk smk <ste...@gm...> wrote: >>> >>>> Hi >>>> >>>> As Sreenadh mentioned not every response is an HtmlPage object however >>>> all of them are Page objects. Thus you have to typecast accordingly. >>>> >>>> Check the following code wchich returns the source as String according >>>> to the type of the response. >>>> >>>> Page pageSource = webClient.getPage("http://example.com"); >>>> String pageSourceString = getPageSource(pageSource); >>>> >>>> public static String getPageSource(Page page) >>>> { >>>> if(page instanceof HtmlPage) >>>> { >>>> return ((HtmlPage)page).asXml(); >>>> } >>>> else if(page instanceof JavaScriptPage) >>>> { >>>> return ((JavaScriptPage)page).getContent(); >>>> } >>>> else if(page instanceof TextPage) >>>> { >>>> return ((TextPage)page).getContent(); >>>> } >>>> else //page instanceof UnexpectedPage >>>> { >>>> return ((UnexpectedPage)page).getWebResponse().getContentAsString(); >>>> } >>>> } >>>> >>>> From the above example you can see that there are 4 different types of >>>> Pages that webClient returns. >>>> >>>> The method used here returns the string of the source however you can >>>> modify the code to your needs according to the instance is returned. >>>> >>>> Stergios >>>> >>>> >>>> >>>> >>>> >>>> 2014-02-05 Ahmed Ashour <asa...@ya...>: >>>> >>>>> Hi, >>>>> >>>>> This happens when HtmlUnit determines the content type of this page to >>>>> be plain text, not HTML. >>>>> >>>>> Please send the details of the complete case. >>>>> >>>>> Ahmed >>>>> ------------------------------ >>>>> *From:* Sreenath <sre...@gm...> >>>>> *To:* "htm...@li..." < >>>>> htm...@li...> >>>>> *Sent:* Wednesday, February 5, 2014 11:53 AM >>>>> *Subject:* [Htmlunit-user] java.lang.ClassCastException: >>>>> com.gargoylesoftware.htmlunit.TextPage cannot be cast to >>>>> com.gargoylesoftware.htmlunit.html.HtmlPage >>>>> >>>>> Hello, >>>>> >>>>> I have tried to load pme web page url and did submission of the page, >>>>> second page is not getting loaded due to following issue. >>>>> >>>>> >>>>> java.lang.ClassCastException: com.gargoylesoftware.htmlunit.TextPage >>>>> cannot be cast to com.gargoylesoftware.htmlunit.html.HtmlPage >>>>> >>>>> Note: my page is type of HtmlPage, not able to cast to HtmlPage >>>>> >>>>> Please advice why the second page is coming as type of >>>>> com.gargoylesoftware.htmlunit.TextPage, and how can assign to HtmlPage >>>>> type the same. >>>>> >>>>> Thanks in Advance >>>>> Sreenadh >>>>> >>>>> >>>>> >>>>> ------------------------------------------------------------------------------ >>>>> Managing the Performance of Cloud-Based Applications >>>>> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. >>>>> Read the Whitepaper. >>>>> >>>>> http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk >>>>> _______________________________________________ >>>>> Htmlunit-user mailing list >>>>> Htm...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/htmlunit-user >>>>> >>>>> >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> Managing the Performance of Cloud-Based Applications >>>> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. >>>> Read the Whitepaper. >>>> >>>> http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk >>>> _______________________________________________ >>>> Htmlunit-user mailing list >>>> Htm...@li... >>>> https://lists.sourceforge.net/lists/listinfo/htmlunit-user >>>> >>>> >>> >> > |
From: Sreenadh VP <sre...@co...> - 2014-02-05 10:20:16
|
Hi, Thanks for your attention and response. I have following code WebRequest request = new WebRequest(new URL(Url)); HtmlPage page = webClient.getPage(request); HtmlButton elementTocick = (HtmlButton)page.getElementById("elementId"); page = elementTocick.click(); // fails with java.lang.ClassCastException: com.gargoylesoftware.htmlunit.TextPage cannot be cast to com.gargoylesoftware.htmlunit.html.HtmlPage Need to assign new page after click to* page* reference of type HtmlPage, how can do the the same? Please advice Sreenadh On Wed, Feb 5, 2014 at 2:49 PM, smk smk <ste...@gm...> wrote: > Hi > > As Sreenadh mentioned not every response is an HtmlPage object however all > of them are Page objects. Thus you have to typecast accordingly. > > Check the following code wchich returns the source as String according to > the type of the response. > > Page pageSource = webClient.getPage("http://example.com"); > String pageSourceString = getPageSource(pageSource); > > public static String getPageSource(Page page) > { > if(page instanceof HtmlPage) > { > return ((HtmlPage)page).asXml(); > } > else if(page instanceof JavaScriptPage) > { > return ((JavaScriptPage)page).getContent(); > } > else if(page instanceof TextPage) > { > return ((TextPage)page).getContent(); > } > else //page instanceof UnexpectedPage > { > return ((UnexpectedPage)page).getWebResponse().getContentAsString(); > } > } > > From the above example you can see that there are 4 different types of > Pages that webClient returns. > > The method used here returns the string of the source however you can > modify the code to your needs according to the instance is returned. > > Stergios > > > > > > 2014-02-05 Ahmed Ashour <asa...@ya...>: > >> Hi, >> >> This happens when HtmlUnit determines the content type of this page to be >> plain text, not HTML. >> >> Please send the details of the complete case. >> >> Ahmed >> ------------------------------ >> *From:* Sreenath <sre...@gm...> >> *To:* "htm...@li..." < >> htm...@li...> >> *Sent:* Wednesday, February 5, 2014 11:53 AM >> *Subject:* [Htmlunit-user] java.lang.ClassCastException: >> com.gargoylesoftware.htmlunit.TextPage cannot be cast to >> com.gargoylesoftware.htmlunit.html.HtmlPage >> >> Hello, >> >> I have tried to load pme web page url and did submission of the page, >> second page is not getting loaded due to following issue. >> >> >> java.lang.ClassCastException: com.gargoylesoftware.htmlunit.TextPage >> cannot be cast to com.gargoylesoftware.htmlunit.html.HtmlPage >> >> Note: my page is type of HtmlPage, not able to cast to HtmlPage >> >> Please advice why the second page is coming as type of >> com.gargoylesoftware.htmlunit.TextPage, and how can assign to HtmlPage >> type the same. >> >> Thanks in Advance >> Sreenadh >> >> >> >> ------------------------------------------------------------------------------ >> Managing the Performance of Cloud-Based Applications >> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. >> Read the Whitepaper. >> >> http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk >> _______________________________________________ >> Htmlunit-user mailing list >> Htm...@li... >> https://lists.sourceforge.net/lists/listinfo/htmlunit-user >> >> > > > ------------------------------------------------------------------------------ > Managing the Performance of Cloud-Based Applications > Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. > Read the Whitepaper. > > http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > > |
From: smk s. <ste...@gm...> - 2014-02-05 10:11:50
|
Change this "TextPage = responseAfterClick = elementTocick.click();" To this "TextPage responseAfterClick = elementTocick.click();" 2014-02-05 smk smk <ste...@gm...>: > Hi > > The problem is that you initialize the page as HtmlPage and not as Page. > > Thus you should do > > *Page* page = webClient.getPage(request); //not HtmlPage > > and then after the click you can do the check of the response as > mentioned at the first response. > > page = elementTocick.click(); > > if(page instanceof TextPage) > ......... > else if( > ...... > > My opinion though is to assign a new Page object at the response after the > click > > e.g > > Page responseAfterClick = elementTocick.click(); > if(responseAfterClick instanceof TextPage) > ....... > else if ( > ....... > > and if you are sure that it always rerurns a TextPage then you can > initialize it as TextPage from the beginning > > TextPage = responseAfterClick = elementTocick.click(); > > Hope that helps > > Stergios > > > > 2014-02-05 Sreenadh VP <sre...@co...>: > > Hi, >> >> Thanks for your attention and response. >> >> I have following code >> >> WebRequest request = new WebRequest(new URL(Url)); >> >> HtmlPage page = webClient.getPage(request); >> >> HtmlButton elementTocick = (HtmlButton)page.getElementById("elementId"); >> >> page = elementTocick.click(); // fails with >> java.lang.ClassCastException: com.gargoylesoftware.htmlunit.TextPage cannot >> be cast to com.gargoylesoftware.htmlunit.html.HtmlPage >> >> Need to assign new page after click to* page* reference of type >> HtmlPage, how can do the the same? Please advice >> >> Sreenadh >> >> >> On Wed, Feb 5, 2014 at 2:49 PM, smk smk <ste...@gm...> wrote: >> >>> Hi >>> >>> As Sreenadh mentioned not every response is an HtmlPage object however >>> all of them are Page objects. Thus you have to typecast accordingly. >>> >>> Check the following code wchich returns the source as String according >>> to the type of the response. >>> >>> Page pageSource = webClient.getPage("http://example.com"); >>> String pageSourceString = getPageSource(pageSource); >>> >>> public static String getPageSource(Page page) >>> { >>> if(page instanceof HtmlPage) >>> { >>> return ((HtmlPage)page).asXml(); >>> } >>> else if(page instanceof JavaScriptPage) >>> { >>> return ((JavaScriptPage)page).getContent(); >>> } >>> else if(page instanceof TextPage) >>> { >>> return ((TextPage)page).getContent(); >>> } >>> else //page instanceof UnexpectedPage >>> { >>> return ((UnexpectedPage)page).getWebResponse().getContentAsString(); >>> } >>> } >>> >>> From the above example you can see that there are 4 different types of >>> Pages that webClient returns. >>> >>> The method used here returns the string of the source however you can >>> modify the code to your needs according to the instance is returned. >>> >>> Stergios >>> >>> >>> >>> >>> >>> 2014-02-05 Ahmed Ashour <asa...@ya...>: >>> >>>> Hi, >>>> >>>> This happens when HtmlUnit determines the content type of this page to >>>> be plain text, not HTML. >>>> >>>> Please send the details of the complete case. >>>> >>>> Ahmed >>>> ------------------------------ >>>> *From:* Sreenath <sre...@gm...> >>>> *To:* "htm...@li..." < >>>> htm...@li...> >>>> *Sent:* Wednesday, February 5, 2014 11:53 AM >>>> *Subject:* [Htmlunit-user] java.lang.ClassCastException: >>>> com.gargoylesoftware.htmlunit.TextPage cannot be cast to >>>> com.gargoylesoftware.htmlunit.html.HtmlPage >>>> >>>> Hello, >>>> >>>> I have tried to load pme web page url and did submission of the page, >>>> second page is not getting loaded due to following issue. >>>> >>>> >>>> java.lang.ClassCastException: com.gargoylesoftware.htmlunit.TextPage >>>> cannot be cast to com.gargoylesoftware.htmlunit.html.HtmlPage >>>> >>>> Note: my page is type of HtmlPage, not able to cast to HtmlPage >>>> >>>> Please advice why the second page is coming as type of >>>> com.gargoylesoftware.htmlunit.TextPage, and how can assign to HtmlPage >>>> type the same. >>>> >>>> Thanks in Advance >>>> Sreenadh >>>> >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> Managing the Performance of Cloud-Based Applications >>>> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. >>>> Read the Whitepaper. >>>> >>>> http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk >>>> _______________________________________________ >>>> Htmlunit-user mailing list >>>> Htm...@li... >>>> https://lists.sourceforge.net/lists/listinfo/htmlunit-user >>>> >>>> >>> >>> >>> ------------------------------------------------------------------------------ >>> Managing the Performance of Cloud-Based Applications >>> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. >>> Read the Whitepaper. >>> >>> http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk >>> _______________________________________________ >>> Htmlunit-user mailing list >>> Htm...@li... >>> https://lists.sourceforge.net/lists/listinfo/htmlunit-user >>> >>> >> > |
From: smk s. <ste...@gm...> - 2014-02-05 10:10:08
|
Hi The problem is that you initialize the page as HtmlPage and not as Page. Thus you should do *Page* page = webClient.getPage(request); //not HtmlPage and then after the click you can do the check of the response as mentioned at the first response. page = elementTocick.click(); if(page instanceof TextPage) ......... else if( ...... My opinion though is to assign a new Page object at the response after the click e.g Page responseAfterClick = elementTocick.click(); if(responseAfterClick instanceof TextPage) ....... else if ( ....... and if you are sure that it always rerurns a TextPage then you can initialize it as TextPage from the beginning TextPage = responseAfterClick = elementTocick.click(); Hope that helps Stergios 2014-02-05 Sreenadh VP <sre...@co...>: > Hi, > > Thanks for your attention and response. > > I have following code > > WebRequest request = new WebRequest(new URL(Url)); > > HtmlPage page = webClient.getPage(request); > > HtmlButton elementTocick = (HtmlButton)page.getElementById("elementId"); > > page = elementTocick.click(); // fails with > java.lang.ClassCastException: com.gargoylesoftware.htmlunit.TextPage cannot > be cast to com.gargoylesoftware.htmlunit.html.HtmlPage > > Need to assign new page after click to* page* reference of type > HtmlPage, how can do the the same? Please advice > > Sreenadh > > > On Wed, Feb 5, 2014 at 2:49 PM, smk smk <ste...@gm...> wrote: > >> Hi >> >> As Sreenadh mentioned not every response is an HtmlPage object however >> all of them are Page objects. Thus you have to typecast accordingly. >> >> Check the following code wchich returns the source as String according to >> the type of the response. >> >> Page pageSource = webClient.getPage("http://example.com"); >> String pageSourceString = getPageSource(pageSource); >> >> public static String getPageSource(Page page) >> { >> if(page instanceof HtmlPage) >> { >> return ((HtmlPage)page).asXml(); >> } >> else if(page instanceof JavaScriptPage) >> { >> return ((JavaScriptPage)page).getContent(); >> } >> else if(page instanceof TextPage) >> { >> return ((TextPage)page).getContent(); >> } >> else //page instanceof UnexpectedPage >> { >> return ((UnexpectedPage)page).getWebResponse().getContentAsString(); >> } >> } >> >> From the above example you can see that there are 4 different types of >> Pages that webClient returns. >> >> The method used here returns the string of the source however you can >> modify the code to your needs according to the instance is returned. >> >> Stergios >> >> >> >> >> >> 2014-02-05 Ahmed Ashour <asa...@ya...>: >> >>> Hi, >>> >>> This happens when HtmlUnit determines the content type of this page to >>> be plain text, not HTML. >>> >>> Please send the details of the complete case. >>> >>> Ahmed >>> ------------------------------ >>> *From:* Sreenath <sre...@gm...> >>> *To:* "htm...@li..." < >>> htm...@li...> >>> *Sent:* Wednesday, February 5, 2014 11:53 AM >>> *Subject:* [Htmlunit-user] java.lang.ClassCastException: >>> com.gargoylesoftware.htmlunit.TextPage cannot be cast to >>> com.gargoylesoftware.htmlunit.html.HtmlPage >>> >>> Hello, >>> >>> I have tried to load pme web page url and did submission of the page, >>> second page is not getting loaded due to following issue. >>> >>> >>> java.lang.ClassCastException: com.gargoylesoftware.htmlunit.TextPage >>> cannot be cast to com.gargoylesoftware.htmlunit.html.HtmlPage >>> >>> Note: my page is type of HtmlPage, not able to cast to HtmlPage >>> >>> Please advice why the second page is coming as type of >>> com.gargoylesoftware.htmlunit.TextPage, and how can assign to HtmlPage >>> type the same. >>> >>> Thanks in Advance >>> Sreenadh >>> >>> >>> >>> ------------------------------------------------------------------------------ >>> Managing the Performance of Cloud-Based Applications >>> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. >>> Read the Whitepaper. >>> >>> http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk >>> _______________________________________________ >>> Htmlunit-user mailing list >>> Htm...@li... >>> https://lists.sourceforge.net/lists/listinfo/htmlunit-user >>> >>> >> >> >> ------------------------------------------------------------------------------ >> Managing the Performance of Cloud-Based Applications >> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. >> Read the Whitepaper. >> >> http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk >> _______________________________________________ >> Htmlunit-user mailing list >> Htm...@li... >> https://lists.sourceforge.net/lists/listinfo/htmlunit-user >> >> > |
From: smk s. <ste...@gm...> - 2014-02-05 09:46:40
|
Ahmed Thank you very much for the update. I just tested the code and works as it expected. Stergios 2014-02-05 asashour <asa...@ya...>: > Hi, > > The last fix was for the class and properties, now it is fine for methods > as > well. > > Please get latest code and hint if you have any issue. > > Ahmed > > > stergios wrote > > I updated the source and now the Java class is initialized as it should > > however I was not able to call any method from the corresponding class. > > > > DEBUG [main] write: Object Loaded! > > <br> > > ERROR [main] runtimeError: message=[Java method "playVideo" was invoked > > with [object HTMLObjectElement] as "this" value that can not be converted > > to Java type WMP.] sourceName=[.......objecttagtesting.html from (4, 9) > to > > (12, 10)] line=[8] lineSource=[null] lineOffset=[0] > > INFO [main] Caught script exception > > > > > > -- > View this message in context: > http://htmlunit.10904.n7.nabble.com/Map-bject-to-custom-JavaClass-tp32980p33061.html > Sent from the HtmlUnit - General mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------------ > Managing the Performance of Cloud-Based Applications > Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. > Read the Whitepaper. > > http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > |
From: smk s. <ste...@gm...> - 2014-02-05 09:19:50
|
Hi As Sreenadh mentioned not every response is an HtmlPage object however all of them are Page objects. Thus you have to typecast accordingly. Check the following code wchich returns the source as String according to the type of the response. Page pageSource = webClient.getPage("http://example.com"); String pageSourceString = getPageSource(pageSource); public static String getPageSource(Page page) { if(page instanceof HtmlPage) { return ((HtmlPage)page).asXml(); } else if(page instanceof JavaScriptPage) { return ((JavaScriptPage)page).getContent(); } else if(page instanceof TextPage) { return ((TextPage)page).getContent(); } else //page instanceof UnexpectedPage { return ((UnexpectedPage)page).getWebResponse().getContentAsString(); } } >From the above example you can see that there are 4 different types of Pages that webClient returns. The method used here returns the string of the source however you can modify the code to your needs according to the instance is returned. Stergios 2014-02-05 Ahmed Ashour <asa...@ya...>: > Hi, > > This happens when HtmlUnit determines the content type of this page to be > plain text, not HTML. > > Please send the details of the complete case. > > Ahmed > ------------------------------ > *From:* Sreenath <sre...@gm...> > *To:* "htm...@li..." < > htm...@li...> > *Sent:* Wednesday, February 5, 2014 11:53 AM > *Subject:* [Htmlunit-user] java.lang.ClassCastException: > com.gargoylesoftware.htmlunit.TextPage cannot be cast to > com.gargoylesoftware.htmlunit.html.HtmlPage > > Hello, > > I have tried to load pme web page url and did submission of the page, > second page is not getting loaded due to following issue. > > > java.lang.ClassCastException: com.gargoylesoftware.htmlunit.TextPage > cannot be cast to com.gargoylesoftware.htmlunit.html.HtmlPage > > Note: my page is type of HtmlPage, not able to cast to HtmlPage > > Please advice why the second page is coming as type of > com.gargoylesoftware.htmlunit.TextPage, and how can assign to HtmlPage > type the same. > > Thanks in Advance > Sreenadh > > > > ------------------------------------------------------------------------------ > Managing the Performance of Cloud-Based Applications > Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. > Read the Whitepaper. > > http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > > |