You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(10) |
Aug
(30) |
Sep
(15) |
Oct
(26) |
Nov
(12) |
Dec
(17) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(7) |
Feb
(27) |
Mar
(73) |
Apr
(17) |
May
(17) |
Jun
(78) |
Jul
(67) |
Aug
(60) |
Sep
(89) |
Oct
(140) |
Nov
(173) |
Dec
(46) |
2004 |
Jan
(39) |
Feb
(7) |
Mar
(21) |
Apr
(31) |
May
(13) |
Jun
(86) |
Jul
(14) |
Aug
(14) |
Sep
(53) |
Oct
(184) |
Nov
(186) |
Dec
(319) |
2005 |
Jan
(336) |
Feb
(274) |
Mar
(226) |
Apr
(102) |
May
(196) |
Jun
(130) |
Jul
(119) |
Aug
(143) |
Sep
(76) |
Oct
(85) |
Nov
(70) |
Dec
(159) |
2006 |
Jan
(125) |
Feb
(100) |
Mar
(80) |
Apr
(39) |
May
(55) |
Jun
(58) |
Jul
(50) |
Aug
(76) |
Sep
(55) |
Oct
(101) |
Nov
(163) |
Dec
(85) |
2007 |
Jan
(56) |
Feb
(53) |
Mar
(180) |
Apr
(221) |
May
(290) |
Jun
(199) |
Jul
(322) |
Aug
(515) |
Sep
(121) |
Oct
(297) |
Nov
(177) |
Dec
(103) |
2008 |
Jan
(516) |
Feb
(315) |
Mar
(586) |
Apr
(615) |
May
(197) |
Jun
(381) |
Jul
(390) |
Aug
(195) |
Sep
(603) |
Oct
(499) |
Nov
(622) |
Dec
(350) |
2009 |
Jan
(313) |
Feb
(338) |
Mar
(507) |
Apr
(317) |
May
(197) |
Jun
(375) |
Jul
(235) |
Aug
(424) |
Sep
(410) |
Oct
(338) |
Nov
(286) |
Dec
(306) |
2010 |
Jan
(367) |
Feb
(339) |
Mar
(371) |
Apr
(172) |
May
(233) |
Jun
(264) |
Jul
(421) |
Aug
(110) |
Sep
(218) |
Oct
(189) |
Nov
(185) |
Dec
(168) |
2011 |
Jan
(145) |
Feb
(213) |
Mar
(205) |
Apr
(64) |
May
(159) |
Jun
(67) |
Jul
(104) |
Aug
(126) |
Sep
(144) |
Oct
(106) |
Nov
(154) |
Dec
(225) |
2012 |
Jan
(111) |
Feb
(87) |
Mar
(131) |
Apr
(102) |
May
(180) |
Jun
(160) |
Jul
(412) |
Aug
(315) |
Sep
(311) |
Oct
(369) |
Nov
(464) |
Dec
(284) |
2013 |
Jan
(343) |
Feb
(165) |
Mar
(174) |
Apr
(120) |
May
(153) |
Jun
(134) |
Jul
(202) |
Aug
(105) |
Sep
(228) |
Oct
(332) |
Nov
(192) |
Dec
(219) |
2014 |
Jan
(348) |
Feb
(194) |
Mar
(189) |
Apr
(188) |
May
(297) |
Jun
(206) |
Jul
(79) |
Aug
(279) |
Sep
(111) |
Oct
(159) |
Nov
(61) |
Dec
(78) |
2015 |
Jan
(152) |
Feb
(145) |
Mar
(239) |
Apr
(223) |
May
(248) |
Jun
(296) |
Jul
(172) |
Aug
(189) |
Sep
(338) |
Oct
(217) |
Nov
(131) |
Dec
(184) |
2016 |
Jan
(118) |
Feb
(221) |
Mar
(414) |
Apr
(412) |
May
(303) |
Jun
(133) |
Jul
(129) |
Aug
(121) |
Sep
(136) |
Oct
(67) |
Nov
(89) |
Dec
(245) |
2017 |
Jan
(349) |
Feb
(90) |
Mar
(328) |
Apr
(430) |
May
(284) |
Jun
(199) |
Jul
(164) |
Aug
(120) |
Sep
(57) |
Oct
(105) |
Nov
(108) |
Dec
(146) |
2018 |
Jan
(85) |
Feb
(48) |
Mar
(97) |
Apr
(62) |
May
(64) |
Jun
(136) |
Jul
(123) |
Aug
(87) |
Sep
(17) |
Oct
(27) |
Nov
(9) |
Dec
(16) |
2019 |
Jan
(9) |
Feb
(17) |
Mar
(18) |
Apr
(14) |
May
(8) |
Jun
|
Jul
(6) |
Aug
(12) |
Sep
(5) |
Oct
|
Nov
(2) |
Dec
|
2020 |
Jan
(8) |
Feb
|
Mar
(6) |
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
(4) |
Oct
(1) |
Nov
|
Dec
|
2021 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
(4) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(4) |
Dec
|
2022 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
|
2023 |
Jan
|
Feb
(6) |
Mar
(9) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2024 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <rb...@us...> - 2018-07-25 17:38:55
|
Revision: 15495 http://sourceforge.net/p/htmlunit/code/15495 Author: rbri Date: 2018-07-25 17:38:50 +0000 (Wed, 25 Jul 2018) Log Message: ----------- event listeners had to be functions, other types are ignored Issue 1976 Modified Paths: -------------- trunk/htmlunit/src/changes/changes.xml trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/ApplicationCache.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/MessagePort.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/EventListenersContainer.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/event/EventListenersContainerTest.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/worker/WorkerTest.java Modified: trunk/htmlunit/src/changes/changes.xml =================================================================== --- trunk/htmlunit/src/changes/changes.xml 2018-07-22 17:37:11 UTC (rev 15494) +++ trunk/htmlunit/src/changes/changes.xml 2018-07-25 17:38:50 UTC (rev 15495) @@ -8,6 +8,9 @@ <body> <release version="2.32" date="xx 2018" description="Bugfixes, FIREFOX_45 removed, FIREFOX_60 added"> + <action type="fix" dev="rbri" issue="1976"> + Event listeners had to be functions, other types are ignored. + </action> <action type="fix" dev="rbri"> Setting window.clientInformation is ignored in IE. </action> Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/ApplicationCache.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/ApplicationCache.java 2018-07-22 17:37:11 UTC (rev 15494) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/ApplicationCache.java 2018-07-25 17:38:50 UTC (rev 15495) @@ -29,8 +29,6 @@ import com.gargoylesoftware.htmlunit.javascript.host.event.Event; import com.gargoylesoftware.htmlunit.javascript.host.event.EventTarget; -import net.sourceforge.htmlunit.corejs.javascript.Scriptable; - /** * <p>A collection of offline resources as defined in the HTML5 spec. * Intended to support offline web applications.</p> @@ -224,10 +222,7 @@ } private void setHandlerForJavaScript(final String eventName, final Object handler) { - if (handler == null || handler instanceof Scriptable) { - getEventListenersContainer().setEventHandler(eventName, handler); - } - // Otherwise, fail silently. + getEventListenersContainer().setEventHandler(eventName, handler); } /** Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/MessagePort.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/MessagePort.java 2018-07-22 17:37:11 UTC (rev 15494) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/MessagePort.java 2018-07-25 17:38:50 UTC (rev 15495) @@ -32,7 +32,6 @@ import com.gargoylesoftware.htmlunit.javascript.host.event.MessageEvent; import net.sourceforge.htmlunit.corejs.javascript.ContextFactory; -import net.sourceforge.htmlunit.corejs.javascript.Function; /** * A JavaScript object for {@code MessagePort}. @@ -82,10 +81,7 @@ } private void setHandlerForJavaScript(final String eventName, final Object handler) { - if (handler == null || handler instanceof Function) { - getEventListenersContainer().setEventHandler(eventName, handler); - } - // Otherwise, fail silently. + getEventListenersContainer().setEventHandler(eventName, handler); } /** Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2018-07-22 17:37:11 UTC (rev 15494) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2018-07-25 17:38:50 UTC (rev 15495) @@ -1194,7 +1194,7 @@ */ @JsxSetter public void setOnload(final Object onload) { - getEventListenersContainer().setEventHandler(Event.TYPE_LOAD, onload); + setHandlerForJavaScript(Event.TYPE_LOAD, onload); } /** @@ -1203,7 +1203,7 @@ */ @JsxSetter public void setOnblur(final Object onblur) { - getEventListenersContainer().setEventHandler(Event.TYPE_BLUR, onblur); + setHandlerForJavaScript(Event.TYPE_BLUR, onblur); } /** @@ -1377,10 +1377,7 @@ } private void setHandlerForJavaScript(final String eventName, final Object handler) { - if (handler == null || handler instanceof Function) { - getEventListenersContainer().setEventHandler(eventName, handler); - } - // Otherwise, fail silently. + getEventListenersContainer().setEventHandler(eventName, handler); } /** Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/EventListenersContainer.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/EventListenersContainer.java 2018-07-22 17:37:11 UTC (rev 15494) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/EventListenersContainer.java 2018-07-25 17:38:50 UTC (rev 15495) @@ -57,7 +57,7 @@ static class TypeContainer implements Serializable { private List<Scriptable> capturingListeners_; private List<Scriptable> bubblingListeners_; - private Object handler_; + private Function handler_; TypeContainer() { capturingListeners_ = Collections.unmodifiableList(new ArrayList<Scriptable>()); @@ -65,7 +65,7 @@ } private TypeContainer(final List<Scriptable> capturingListeners, - final List<Scriptable> bubblingListeners, final Object handler) { + final List<Scriptable> bubblingListeners, final Function handler) { capturingListeners_ = Collections.unmodifiableList(new ArrayList<>(capturingListeners)); bubblingListeners_ = Collections.unmodifiableList(new ArrayList<>(bubblingListeners)); handler_ = handler; @@ -206,10 +206,15 @@ * @param value the new property */ public void setEventHandler(final String eventType, final Object value) { - Object handler = value; - if (handler == Undefined.instance) { + final Function handler; + + // Otherwise, ignore silently. + if (value == Undefined.instance || !(value instanceof Function)) { handler = null; } + else { + handler = (Function) value; + } final TypeContainer container = getTypeContainer(eventType); container.handler_ = handler; Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/event/EventListenersContainerTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/event/EventListenersContainerTest.java 2018-07-22 17:37:11 UTC (rev 15494) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/event/EventListenersContainerTest.java 2018-07-25 17:38:50 UTC (rev 15495) @@ -25,6 +25,7 @@ * Tests for {@link EventListenersContainer}. * * @author Ahmed Ashour + * @author Ronald Brill */ @RunWith(BrowserRunner.class) public class EventListenersContainerTest extends WebDriverTestCase { Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/worker/WorkerTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/worker/WorkerTest.java 2018-07-22 17:37:11 UTC (rev 15494) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/worker/WorkerTest.java 2018-07-25 17:38:50 UTC (rev 15495) @@ -14,6 +14,8 @@ */ package com.gargoylesoftware.htmlunit.javascript.host.worker; +import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.IE; + import java.net.URL; import org.junit.After; @@ -23,6 +25,7 @@ import com.gargoylesoftware.htmlunit.BrowserRunner; import com.gargoylesoftware.htmlunit.BrowserRunner.Alerts; +import com.gargoylesoftware.htmlunit.BrowserRunner.NotYetImplemented; import com.gargoylesoftware.htmlunit.WebDriverTestCase; /** @@ -29,6 +32,7 @@ * Unit tests for {@code Worker}. * * @author Marc Guillemot + * @author Ronald Brill */ @RunWith(BrowserRunner.class) public class WorkerTest extends WebDriverTestCase { @@ -164,4 +168,57 @@ loadPageWithAlerts2(html); } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("function") + public void onmessageFunction() throws Exception { + final String html = "<html><body><script>\n" + + " var myWorker = new Worker('worker.js');\n" + + " myWorker.onmessage = function(e) {};\n" + + " alert(typeof myWorker.onmessage);\n" + + "</script></body></html>\n"; + + loadPageWithAlerts2(html); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "null", + IE = "exception Error") + @NotYetImplemented(IE) + public void onmessageNumber() throws Exception { + final String html = "<html><body><script>\n" + + " var myWorker = new Worker('worker.js');\n" + + " try {\n" + + " myWorker.onmessage = 17;\n" + + " alert(myWorker.onmessage);\n" + + " } catch(e) { alert('exception ' + e.name); }\n" + + "</script></body></html>\n"; + + loadPageWithAlerts2(html); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "null", + IE = "HtmlUnit") + @NotYetImplemented(IE) + public void onmessageString() throws Exception { + final String html = "<html><body><script>\n" + + " var myWorker = new Worker('worker.js');\n" + + " try {\n" + + " myWorker.onmessage = 'HtmlUnit';\n" + + " alert(myWorker.onmessage);\n" + + " } catch(e) { alert('exception ' + e.name); }\n" + + "</script></body></html>\n"; + + loadPageWithAlerts2(html); + } } |
From: RBRi <rb...@us...> - 2018-07-24 16:33:55
|
Have you solved this? --- ** [feature-requests:#254] Disable HtmlUnit logging** **Status:** pending **Group:** 2.19 **Created:** Thu Jun 14, 2018 04:35 AM UTC by Ganesh Prakash Barshile **Last Updated:** Sat Jun 30, 2018 12:40 PM UTC **Owner:** RBRi **Attachments:** - [Logger.png](https://sourceforge.net/p/htmlunit/feature-requests/254/attachment/Logger.png) (132.4 kB; image/png) We want to disable all logs of htmlunit unit. We tried it using log4j & commons logging but unable to do it. We tried following code:- Logger.getLogger("com.gargoylesoftware.htmlunit").setLevel(Level.OFF); Logger.getLogger("org.apache.commons.httpclient").setLevel(Level.OFF); Logger.getLogger("com.gargoylesoftware.htmlunit.javascript.StrictErrorReporter").setLevel(Level.OFF); Logger.getLogger("com.gargoylesoftware.htmlunit.javascript.host.ActiveXObject").setLevel(Level.OFF);Logger.getLogger("com.gargoylesoftware.htmlunit.javascript.host.html.HTMLDocument").setLevel(Level.OFF); Logger.getLogger("com.gargoylesoftware.htmlunit.html.HtmlScript").setLevel(Level.OFF); Logger.getLogger("com.gargoylesoftware.htmlunit.javascript.host.WindowProxy").setLevel(Level.OFF); Logger.getLogger("org.apache").setLevel(Level.OFF); Logger.getRootLogger().setLevel(Level.OFF); is there any solution to disable all logs from htmlunit? --- Sent from sourceforge.net because htm...@li... is subscribed to https://sourceforge.net/p/htmlunit/feature-requests/ To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/htmlunit/admin/feature-requests/options. Or, if this is a mailing list, you can unsubscribe from the mailing list. |
From: RBRi <rb...@us...> - 2018-07-24 16:33:03
|
Sorry, for asking again. I need a way to reproduce this, any help to understand the problem is welcome. * maybe you are able to provide the url your are calling with your initial call * maybe you can provide some html pieces showing, how this missing stuff is called by the real browsers - is there a script tag that refers them or does some javascript do the call And finally please place your `webClient.waitForBackgroundJavaScript(60000);` call after the get class (this is not an option). --- ** [bugs:#1975] Some urls are missing while getting request from WebClient using HtmlUnit** **Status:** open **Group:** 2.31 **Created:** Tue Jul 24, 2018 07:50 AM UTC by Ibrahim S **Last Updated:** Tue Jul 24, 2018 04:26 PM UTC **Owner:** nobody List of Issues: Not Loading urls like facebook.com with type json, google analytics urls with type javascript, gif and xhr. For example in Google Analytics out of 5 fired 4 urls. 1 urls is not firing. Please check our code and let us know how to fire all urls at a time in conversion.async.js ~~~ WebClient webClient = new WebClient(BrowserVersion.FIREFOX_52); webClient.getCookieManager().clearCookies(); webClient.getCache().clear(); webClient.setAjaxController(new NicelyResynchronizingAjaxController()); webClient.setCssErrorHandler(new SilentCssErrorHandler()); webClient.getOptions().setTimeout(120000); // to wait for AJAX webClient.waitForBackgroundJavaScript(60000); webClient.getOptions().setRedirectEnabled(true); webClient.getOptions().setJavaScriptEnabled(true); webClient.getOptions().setPrintContentOnFailingStatusCode(false); webClient.getOptions().setThrowExceptionOnFailingStatusCode(false); webClient.getOptions().setThrowExceptionOnScriptError(false); webClient.getOptions().setUseInsecureSSL(true); webClient.getOptions().setDoNotTrackEnabled(false); new WebConnectionWrapper(webClient) { int conversionUrlCount = 0; @Override public WebResponse getResponse(WebRequest request) throws IOException { System.out.println(request.getUrl()); WebResponse response = super.getResponse(request); System.out.println(response.getStatusCode()); if (response.getStatusCode() < 400) { resourceUrls.add(request.getUrl()); } return response; } }; String url = "", HtmlPage page = webClient.getPage(url); // to forcibly load the link HtmlLink link = page.getFirstByXPath("//link"); link.getWebResponse(true); // to forcibly load the image try { HtmlImage image = page.getFirstByXPath("//img"); image.getImageReader(); } catch (IOException e) { //don't need to crash at this point, //just let the user know that a wrong file has been passed. } ~~~ --- Sent from sourceforge.net because htm...@li... is subscribed to https://sourceforge.net/p/htmlunit/bugs/ To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/htmlunit/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list. |
From: RBRi <rb...@us...> - 2018-07-24 16:26:23
|
- Description has changed: Diff: ~~~~ --- old +++ new @@ -6,7 +6,7 @@ ~~~ - WebClient webClient = new WebClient(BrowserVersion.FIREFOX_52); +WebClient webClient = new WebClient(BrowserVersion.FIREFOX_52); webClient.getCookieManager().clearCookies(); webClient.getCache().clear(); ~~~~ --- ** [bugs:#1975] Some urls are missing while getting request from WebClient using HtmlUnit** **Status:** open **Group:** 2.31 **Created:** Tue Jul 24, 2018 07:50 AM UTC by Ibrahim S **Last Updated:** Tue Jul 24, 2018 04:26 PM UTC **Owner:** nobody List of Issues: Not Loading urls like facebook.com with type json, google analytics urls with type javascript, gif and xhr. For example in Google Analytics out of 5 fired 4 urls. 1 urls is not firing. Please check our code and let us know how to fire all urls at a time in conversion.async.js ~~~ WebClient webClient = new WebClient(BrowserVersion.FIREFOX_52); webClient.getCookieManager().clearCookies(); webClient.getCache().clear(); webClient.setAjaxController(new NicelyResynchronizingAjaxController()); webClient.setCssErrorHandler(new SilentCssErrorHandler()); webClient.getOptions().setTimeout(120000); // to wait for AJAX webClient.waitForBackgroundJavaScript(60000); webClient.getOptions().setRedirectEnabled(true); webClient.getOptions().setJavaScriptEnabled(true); webClient.getOptions().setPrintContentOnFailingStatusCode(false); webClient.getOptions().setThrowExceptionOnFailingStatusCode(false); webClient.getOptions().setThrowExceptionOnScriptError(false); webClient.getOptions().setUseInsecureSSL(true); webClient.getOptions().setDoNotTrackEnabled(false); new WebConnectionWrapper(webClient) { int conversionUrlCount = 0; @Override public WebResponse getResponse(WebRequest request) throws IOException { System.out.println(request.getUrl()); WebResponse response = super.getResponse(request); System.out.println(response.getStatusCode()); if (response.getStatusCode() < 400) { resourceUrls.add(request.getUrl()); } return response; } }; String url = "", HtmlPage page = webClient.getPage(url); // to forcibly load the link HtmlLink link = page.getFirstByXPath("//link"); link.getWebResponse(true); // to forcibly load the image try { HtmlImage image = page.getFirstByXPath("//img"); image.getImageReader(); } catch (IOException e) { //don't need to crash at this point, //just let the user know that a wrong file has been passed. } ~~~ --- Sent from sourceforge.net because htm...@li... is subscribed to https://sourceforge.net/p/htmlunit/bugs/ To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/htmlunit/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list. |
From: RBRi <rb...@us...> - 2018-07-24 16:26:12
|
- Description has changed: Diff: ~~~~ --- old +++ new @@ -7,25 +7,25 @@ ~~~ WebClient webClient = new WebClient(BrowserVersion.FIREFOX_52); - webClient.getCookieManager().clearCookies(); - webClient.getCache().clear(); +webClient.getCookieManager().clearCookies(); +webClient.getCache().clear(); - webClient.setAjaxController(new NicelyResynchronizingAjaxController()); - webClient.setCssErrorHandler(new SilentCssErrorHandler()); - webClient.getOptions().setTimeout(120000); - // to wait for AJAX +webClient.setAjaxController(new NicelyResynchronizingAjaxController()); +webClient.setCssErrorHandler(new SilentCssErrorHandler()); +webClient.getOptions().setTimeout(120000); +// to wait for AJAX - webClient.waitForBackgroundJavaScript(60000); +webClient.waitForBackgroundJavaScript(60000); - webClient.getOptions().setRedirectEnabled(true); - webClient.getOptions().setJavaScriptEnabled(true); - webClient.getOptions().setPrintContentOnFailingStatusCode(false); +webClient.getOptions().setRedirectEnabled(true); +webClient.getOptions().setJavaScriptEnabled(true); +webClient.getOptions().setPrintContentOnFailingStatusCode(false); webClient.getOptions().setThrowExceptionOnFailingStatusCode(false); - webClient.getOptions().setThrowExceptionOnScriptError(false); - webClient.getOptions().setUseInsecureSSL(true); - webClient.getOptions().setDoNotTrackEnabled(false); +webClient.getOptions().setThrowExceptionOnScriptError(false); +webClient.getOptions().setUseInsecureSSL(true); +webClient.getOptions().setDoNotTrackEnabled(false); - new WebConnectionWrapper(webClient) { +new WebConnectionWrapper(webClient) { int conversionUrlCount = 0; @Override @@ -38,21 +38,21 @@ } return response; } - }; +}; String url = "", - HtmlPage page = webClient.getPage(url); +HtmlPage page = webClient.getPage(url); - // to forcibly load the link - HtmlLink link = page.getFirstByXPath("//link"); - link.getWebResponse(true); +// to forcibly load the link +HtmlLink link = page.getFirstByXPath("//link"); +link.getWebResponse(true); - // to forcibly load the image - try { - HtmlImage image = page.getFirstByXPath("//img"); - image.getImageReader(); - } catch (IOException e) { - //don't need to crash at this point, - //just let the user know that a wrong file has been passed. - } +// to forcibly load the image +try { + HtmlImage image = page.getFirstByXPath("//img"); + image.getImageReader(); +} catch (IOException e) { + //don't need to crash at this point, + //just let the user know that a wrong file has been passed. +} ~~~ ~~~~ --- ** [bugs:#1975] Some urls are missing while getting request from WebClient using HtmlUnit** **Status:** open **Group:** 2.31 **Created:** Tue Jul 24, 2018 07:50 AM UTC by Ibrahim S **Last Updated:** Tue Jul 24, 2018 04:24 PM UTC **Owner:** nobody List of Issues: Not Loading urls like facebook.com with type json, google analytics urls with type javascript, gif and xhr. For example in Google Analytics out of 5 fired 4 urls. 1 urls is not firing. Please check our code and let us know how to fire all urls at a time in conversion.async.js ~~~ WebClient webClient = new WebClient(BrowserVersion.FIREFOX_52); webClient.getCookieManager().clearCookies(); webClient.getCache().clear(); webClient.setAjaxController(new NicelyResynchronizingAjaxController()); webClient.setCssErrorHandler(new SilentCssErrorHandler()); webClient.getOptions().setTimeout(120000); // to wait for AJAX webClient.waitForBackgroundJavaScript(60000); webClient.getOptions().setRedirectEnabled(true); webClient.getOptions().setJavaScriptEnabled(true); webClient.getOptions().setPrintContentOnFailingStatusCode(false); webClient.getOptions().setThrowExceptionOnFailingStatusCode(false); webClient.getOptions().setThrowExceptionOnScriptError(false); webClient.getOptions().setUseInsecureSSL(true); webClient.getOptions().setDoNotTrackEnabled(false); new WebConnectionWrapper(webClient) { int conversionUrlCount = 0; @Override public WebResponse getResponse(WebRequest request) throws IOException { System.out.println(request.getUrl()); WebResponse response = super.getResponse(request); System.out.println(response.getStatusCode()); if (response.getStatusCode() < 400) { resourceUrls.add(request.getUrl()); } return response; } }; String url = "", HtmlPage page = webClient.getPage(url); // to forcibly load the link HtmlLink link = page.getFirstByXPath("//link"); link.getWebResponse(true); // to forcibly load the image try { HtmlImage image = page.getFirstByXPath("//img"); image.getImageReader(); } catch (IOException e) { //don't need to crash at this point, //just let the user know that a wrong file has been passed. } ~~~ --- Sent from sourceforge.net because htm...@li... is subscribed to https://sourceforge.net/p/htmlunit/bugs/ To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/htmlunit/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list. |
From: RBRi <rb...@us...> - 2018-07-24 16:24:43
|
- Description has changed: Diff: ~~~~ --- old +++ new @@ -5,6 +5,7 @@ For example in Google Analytics out of 5 fired 4 urls. 1 urls is not firing. Please check our code and let us know how to fire all urls at a time in conversion.async.js +~~~ WebClient webClient = new WebClient(BrowserVersion.FIREFOX_52); webClient.getCookieManager().clearCookies(); webClient.getCache().clear(); @@ -54,5 +55,4 @@ //don't need to crash at this point, //just let the user know that a wrong file has been passed. } - - +~~~ ~~~~ --- ** [bugs:#1975] Some urls are missing while getting request from WebClient using HtmlUnit** **Status:** open **Group:** 2.31 **Created:** Tue Jul 24, 2018 07:50 AM UTC by Ibrahim S **Last Updated:** Tue Jul 24, 2018 09:35 AM UTC **Owner:** nobody List of Issues: Not Loading urls like facebook.com with type json, google analytics urls with type javascript, gif and xhr. For example in Google Analytics out of 5 fired 4 urls. 1 urls is not firing. Please check our code and let us know how to fire all urls at a time in conversion.async.js ~~~ WebClient webClient = new WebClient(BrowserVersion.FIREFOX_52); webClient.getCookieManager().clearCookies(); webClient.getCache().clear(); webClient.setAjaxController(new NicelyResynchronizingAjaxController()); webClient.setCssErrorHandler(new SilentCssErrorHandler()); webClient.getOptions().setTimeout(120000); // to wait for AJAX webClient.waitForBackgroundJavaScript(60000); webClient.getOptions().setRedirectEnabled(true); webClient.getOptions().setJavaScriptEnabled(true); webClient.getOptions().setPrintContentOnFailingStatusCode(false); webClient.getOptions().setThrowExceptionOnFailingStatusCode(false); webClient.getOptions().setThrowExceptionOnScriptError(false); webClient.getOptions().setUseInsecureSSL(true); webClient.getOptions().setDoNotTrackEnabled(false); new WebConnectionWrapper(webClient) { int conversionUrlCount = 0; @Override public WebResponse getResponse(WebRequest request) throws IOException { System.out.println(request.getUrl()); WebResponse response = super.getResponse(request); System.out.println(response.getStatusCode()); if (response.getStatusCode() < 400) { resourceUrls.add(request.getUrl()); } return response; } }; String url = "", HtmlPage page = webClient.getPage(url); // to forcibly load the link HtmlLink link = page.getFirstByXPath("//link"); link.getWebResponse(true); // to forcibly load the image try { HtmlImage image = page.getFirstByXPath("//img"); image.getImageReader(); } catch (IOException e) { //don't need to crash at this point, //just let the user know that a wrong file has been passed. } ~~~ --- Sent from sourceforge.net because htm...@li... is subscribed to https://sourceforge.net/p/htmlunit/bugs/ To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/htmlunit/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list. |
From: RBRi <rb...@us...> - 2018-07-24 09:23:01
|
Can you please provide a sample url to make this reproducible (and a list of requests you are missing). You are sure real browsers doing all the requrests? --- ** [bugs:#1975] Some urls are missing while getting request from WebClient using HtmlUnit** **Status:** open **Group:** 2.31 **Created:** Tue Jul 24, 2018 07:50 AM UTC by Ibrahim S **Last Updated:** Tue Jul 24, 2018 07:51 AM UTC **Owner:** nobody List of Issues: Not Loading urls like facebook.com with type json, google analytics urls with type javascript, gif and xhr. For example in Google Analytics out of 5 fired 4 urls. 1 urls is not firing. Please check our code and let us know how to fire all urls at a time in conversion.async.js WebClient webClient = new WebClient(BrowserVersion.FIREFOX_52); webClient.getCookieManager().clearCookies(); webClient.getCache().clear(); webClient.setAjaxController(new NicelyResynchronizingAjaxController()); webClient.setCssErrorHandler(new SilentCssErrorHandler()); webClient.getOptions().setTimeout(120000); // to wait for AJAX webClient.waitForBackgroundJavaScript(60000); webClient.getOptions().setRedirectEnabled(true); webClient.getOptions().setJavaScriptEnabled(true); webClient.getOptions().setPrintContentOnFailingStatusCode(false); webClient.getOptions().setThrowExceptionOnFailingStatusCode(false); webClient.getOptions().setThrowExceptionOnScriptError(false); webClient.getOptions().setUseInsecureSSL(true); webClient.getOptions().setDoNotTrackEnabled(false); new WebConnectionWrapper(webClient) { int conversionUrlCount = 0; @Override public WebResponse getResponse(WebRequest request) throws IOException { System.out.println(request.getUrl()); WebResponse response = super.getResponse(request); System.out.println(response.getStatusCode()); if (response.getStatusCode() < 400) { resourceUrls.add(request.getUrl()); } return response; } }; String url = "", HtmlPage page = webClient.getPage(url); // to forcibly load the link HtmlLink link = page.getFirstByXPath("//link"); link.getWebResponse(true); // to forcibly load the image try { HtmlImage image = page.getFirstByXPath("//img"); image.getImageReader(); } catch (IOException e) { //don't need to crash at this point, //just let the user know that a wrong file has been passed. } --- Sent from sourceforge.net because htm...@li... is subscribed to https://sourceforge.net/p/htmlunit/bugs/ To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/htmlunit/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list. |
From: RBRi <rb...@us...> - 2018-07-23 18:19:28
|
- **status**: open --> wont-fix --- ** [bugs:#1737] Exception in corejs** **Status:** wont-fix **Group:** Latest SVN **Created:** Thu Dec 24, 2015 07:48 PM UTC by sergey_o **Last Updated:** Mon Jul 23, 2018 06:19 PM UTC **Owner:** nobody Hello! The page loads fine in real FireFox, but an attempt to load it under HtmlUnit results in a bunch of suspicious messages Dec 24, 2015 11:29:05 AM com.gargoylesoftware.htmlunit.html.HtmlScript isExecutionNeeded WARNING: Script is not JavaScript (type: text/ng-template, language: ). Skipping execution. and finally in an exception inside getPage(), in the CoreJS interpreter. Sample code: ~~~~ package my.test; import com.gargoylesoftware.htmlunit.BrowserVersion; import com.gargoylesoftware.htmlunit.WebClient; import com.gargoylesoftware.htmlunit.html.HtmlPage; import java.io.*; import java.util.*; public class Test { static public void testHtmlUnit() { try { WebClient webClient = new WebClient(BrowserVersion.FIREFOX_38); HtmlPage page = webClient.getPage("http://colonelcassad.livejournal.com/2532366.html?format=light"); // String pageAsXml = page.asXml(); // String pageAsText = page.asText(); } catch (Exception ex) { System.err.println("*** Exception: " + ex.getMessage()); ex.printStackTrace(); } } } ~~~~ The exact output follows: Dec 24, 2015 11:29:01 AM com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify WARNING: Obsolete content type encountered: 'application/x-javascript'. Dec 24, 2015 11:29:01 AM com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify WARNING: Obsolete content type encountered: 'text/javascript'. Dec 24, 2015 11:29:01 AM com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify WARNING: Obsolete content type encountered: 'text/javascript'. Dec 24, 2015 11:29:02 AM com.gargoylesoftware.htmlunit.html.HtmlPage loadExternalJavaScriptFile SEVERE: Error loading JavaScript from [http://www.google-analytics.com/analytics.js]. org.apache.http.conn.HttpHostConnectException: Connect to www.google-analytics.com:80 [www.google-analytics.com/127.0.0.1] failed: Connection refused: connect at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:151) at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:353) at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:380) at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236) at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184) at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88) at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110) at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184) at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:71) at com.gargoylesoftware.htmlunit.HttpWebConnection.getResponse(HttpWebConnection.java:177) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseFromWebConnection(WebClient.java:1324) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponse(WebClient.java:1241) at com.gargoylesoftware.htmlunit.html.HtmlPage.loadJavaScriptFromUrl(HtmlPage.java:1031) at com.gargoylesoftware.htmlunit.html.HtmlPage.loadExternalJavaScriptFile(HtmlPage.java:974) at com.gargoylesoftware.htmlunit.html.HtmlScript.executeScriptIfNeeded(HtmlScript.java:399) at com.gargoylesoftware.htmlunit.html.HtmlScript$3.execute(HtmlScript.java:277) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.doProcessPostponedActions(JavaScriptEngine.java:1002) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.access$500(JavaScriptEngine.java:103) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:949) at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:628) at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:513) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:836) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:812) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:800) at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptIfPossible(HtmlPage.java:910) at com.gargoylesoftware.htmlunit.html.HtmlScript.executeInlineScriptIfNeeded(HtmlScript.java:354) at com.gargoylesoftware.htmlunit.html.HtmlScript.executeScriptIfNeeded(HtmlScript.java:415) at com.gargoylesoftware.htmlunit.html.HtmlScript$3.execute(HtmlScript.java:277) at com.gargoylesoftware.htmlunit.html.HtmlScript.onAllChildrenAddedToPage(HtmlScript.java:293) at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:799) at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source) at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:756) 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:1039) at com.gargoylesoftware.htmlunit.html.HTMLParser.parse(HTMLParser.java:252) at com.gargoylesoftware.htmlunit.html.HTMLParser.parseHtml(HTMLParser.java:198) at com.gargoylesoftware.htmlunit.DefaultPageCreator.createHtmlPage(DefaultPageCreator.java:271) at com.gargoylesoftware.htmlunit.DefaultPageCreator.createPage(DefaultPageCreator.java:159) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:478) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:352) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:417) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:402) at my.LJExport.Test.testHtmlUnit(Test.java:17) at my.LJExport.Main.main(Main.java:54) Caused by: java.net.ConnectException: Connection refused: connect at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method) at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:85) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at java.net.Socket.connect(Socket.java:579) at org.apache.http.conn.socket.PlainConnectionSocketFactory.connectSocket(PlainConnectionSocketFactory.java:74) at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:134) ... 52 more Dec 24, 2015 11:29:02 AM com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify WARNING: Obsolete content type encountered: 'application/x-javascript'. Dec 24, 2015 11:29:03 AM com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify WARNING: Obsolete content type encountered: 'application/x-javascript'. Dec 24, 2015 11:29:04 AM com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify WARNING: Obsolete content type encountered: 'application/x-javascript'. Dec 24, 2015 11:29:04 AM com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify WARNING: Obsolete content type encountered: 'application/x-javascript'. Dec 24, 2015 11:29:05 AM com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify WARNING: Obsolete content type encountered: 'application/x-javascript'. Dec 24, 2015 11:29:05 AM com.gargoylesoftware.htmlunit.html.HtmlScript isExecutionNeeded WARNING: Script is not JavaScript (type: text/ng-template, language: ). Skipping execution. Dec 24, 2015 11:29:05 AM com.gargoylesoftware.htmlunit.html.HtmlScript isExecutionNeeded WARNING: Script is not JavaScript (type: text/html, language: ). Skipping execution. Dec 24, 2015 11:29:05 AM com.gargoylesoftware.htmlunit.html.HtmlScript isExecutionNeeded WARNING: Script is not JavaScript (type: text/ng-template, language: ). Skipping execution. Dec 24, 2015 11:29:05 AM com.gargoylesoftware.htmlunit.html.HtmlScript isExecutionNeeded WARNING: Script is not JavaScript (type: text/ng-template, language: ). Skipping execution. Dec 24, 2015 11:29:05 AM com.gargoylesoftware.htmlunit.html.HtmlScript isExecutionNeeded WARNING: Script is not JavaScript (type: text/ng-template, language: ). Skipping execution. Dec 24, 2015 11:29:06 AM com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify WARNING: Obsolete content type encountered: 'application/x-javascript'. *** Exception: TypeError: Expected argument of type object, but instead had type object (http://l-stat.livejournal.net/js/??.ljlib.js?v=1450784615#19) ======= EXCEPTION START ======== EcmaError: lineNumber=[19] column=[0] lineSource=[<no source>] name=[TypeError] sourceName=[http://l-stat.livejournal.net/js/??.ljlib.js?v=1450784615] message=[TypeError: Expected argument of type object, but instead had type object (http://l-stat.livejournal.net/js/??.ljlib.js?v=1450784615#19)] com.gargoylesoftware.htmlunit.ScriptException: TypeError: Expected argument of type object, but instead had type object (http://l-stat.livejournal.net/js/??.ljlib.js?v=1450784615#19) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:954) at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:628) at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:513) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:836) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:812) at com.gargoylesoftware.htmlunit.html.HtmlPage.loadExternalJavaScriptFile(HtmlPage.java:997) at com.gargoylesoftware.htmlunit.html.HtmlScript.executeScriptIfNeeded(HtmlScript.java:399) at com.gargoylesoftware.htmlunit.html.HtmlScript$3.execute(HtmlScript.java:277) at com.gargoylesoftware.htmlunit.html.HtmlScript.onAllChildrenAddedToPage(HtmlScript.java:293) at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:799) at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source) at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:756) 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:1039) at com.gargoylesoftware.htmlunit.html.HTMLParser.parse(HTMLParser.java:252) at com.gargoylesoftware.htmlunit.html.HTMLParser.parseHtml(HTMLParser.java:198) at com.gargoylesoftware.htmlunit.DefaultPageCreator.createHtmlPage(DefaultPageCreator.java:271) at com.gargoylesoftware.htmlunit.DefaultPageCreator.createPage(DefaultPageCreator.java:159) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:478) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:352) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:417) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:402) at my.LJExport.Test.testHtmlUnit(Test.java:17) at my.LJExport.Main.main(Main.java:54) Caused by: net.sourceforge.htmlunit.corejs.javascript.EcmaError: TypeError: Expected argument of type object, but instead had type object (http://l-stat.livejournal.net/js/??.ljlib.js?v=1450784615#19) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3935) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3919) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3944) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.typeError1(ScriptRuntime.java:3954) at net.sourceforge.htmlunit.corejs.javascript.ScriptableObject.ensureScriptableObject(ScriptableObject.java:2193) at net.sourceforge.htmlunit.corejs.javascript.NativeObject.execIdCall(NativeObject.java:303) at net.sourceforge.htmlunit.corejs.javascript.IdFunctionObject.call(IdFunctionObject.java:93) at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpretLoop(Interpreter.java:1536) 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:3286) at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.exec(InterpretedFunction.java:115) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$3.doRun(JavaScriptEngine.java:827) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:939) ... 32 more Enclosed exception: net.sourceforge.htmlunit.corejs.javascript.EcmaError: TypeError: Expected argument of type object, but instead had type object (http://l-stat.livejournal.net/js/??.ljlib.js?v=1450784615#19) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3935) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3919) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3944) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.typeError1(ScriptRuntime.java:3954) at net.sourceforge.htmlunit.corejs.javascript.ScriptableObject.ensureScriptableObject(ScriptableObject.java:2193) at net.sourceforge.htmlunit.corejs.javascript.NativeObject.execIdCall(NativeObject.java:303) at net.sourceforge.htmlunit.corejs.javascript.IdFunctionObject.call(IdFunctionObject.java:93) at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpretLoop(Interpreter.java:1536) at script(http://l-stat.livejournal.net/js/??.ljlib.js?v=1450784615:19) at script.o(http://l-stat.livejournal.net/js/??.ljlib.js?v=1450784615:19) at script(http://l-stat.livejournal.net/js/??.ljlib.js?v=1450784615:19) at script(http://l-stat.livejournal.net/js/??.ljlib.js?v=1450784615:20) at script.o(http://l-stat.livejournal.net/js/??.ljlib.js?v=1450784615:19) at script(http://l-stat.livejournal.net/js/??.ljlib.js?v=1450784615:19) at script(http://l-stat.livejournal.net/js/??.ljlib.js?v=1450784615:20) at script.o(http://l-stat.livejournal.net/js/??.ljlib.js?v=1450784615:19) at script(http://l-stat.livejournal.net/js/??.ljlib.js?v=1450784615:19) at script(http://l-stat.livejournal.net/js/??.ljlib.js?v=1450784615:19) at script(http://l-stat.livejournal.net/js/??.ljlib.js?v=1450784615:19) at script.o(http://l-stat.livejournal.net/js/??.ljlib.js?v=1450784615:19) at script.t(http://l-stat.livejournal.net/js/??.ljlib.js?v=1450784615:19) at script(http://l-stat.livejournal.net/js/??.ljlib.js?v=1450784615:19) 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:3286) at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.exec(InterpretedFunction.java:115) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$3.doRun(JavaScriptEngine.java:827) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:939) at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:628) at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:513) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:836) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:812) at com.gargoylesoftware.htmlunit.html.HtmlPage.loadExternalJavaScriptFile(HtmlPage.java:997) at com.gargoylesoftware.htmlunit.html.HtmlScript.executeScriptIfNeeded(HtmlScript.java:399) at com.gargoylesoftware.htmlunit.html.HtmlScript$3.execute(HtmlScript.java:277) at com.gargoylesoftware.htmlunit.html.HtmlScript.onAllChildrenAddedToPage(HtmlScript.java:293) at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:799) at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source) at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:756) 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:1039) at com.gargoylesoftware.htmlunit.html.HTMLParser.parse(HTMLParser.java:252) at com.gargoylesoftware.htmlunit.html.HTMLParser.parseHtml(HTMLParser.java:198) at com.gargoylesoftware.htmlunit.DefaultPageCreator.createHtmlPage(DefaultPageCreator.java:271) at com.gargoylesoftware.htmlunit.DefaultPageCreator.createPage(DefaultPageCreator.java:159) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:478) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:352) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:417) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:402) at my.LJExport.Test.testHtmlUnit(Test.java:17) at my.LJExport.Main.main(Main.java:54) ======= EXCEPTION END ======== --- Sent from sourceforge.net because htm...@li... is subscribed to https://sourceforge.net/p/htmlunit/bugs/ To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/htmlunit/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list. |
From: RBRi <rb...@us...> - 2018-07-23 18:19:19
|
No feedback, time to close this. --- ** [bugs:#1737] Exception in corejs** **Status:** open **Group:** Latest SVN **Created:** Thu Dec 24, 2015 07:48 PM UTC by sergey_o **Last Updated:** Sun Jul 03, 2016 02:49 PM UTC **Owner:** nobody Hello! The page loads fine in real FireFox, but an attempt to load it under HtmlUnit results in a bunch of suspicious messages Dec 24, 2015 11:29:05 AM com.gargoylesoftware.htmlunit.html.HtmlScript isExecutionNeeded WARNING: Script is not JavaScript (type: text/ng-template, language: ). Skipping execution. and finally in an exception inside getPage(), in the CoreJS interpreter. Sample code: ~~~~ package my.test; import com.gargoylesoftware.htmlunit.BrowserVersion; import com.gargoylesoftware.htmlunit.WebClient; import com.gargoylesoftware.htmlunit.html.HtmlPage; import java.io.*; import java.util.*; public class Test { static public void testHtmlUnit() { try { WebClient webClient = new WebClient(BrowserVersion.FIREFOX_38); HtmlPage page = webClient.getPage("http://colonelcassad.livejournal.com/2532366.html?format=light"); // String pageAsXml = page.asXml(); // String pageAsText = page.asText(); } catch (Exception ex) { System.err.println("*** Exception: " + ex.getMessage()); ex.printStackTrace(); } } } ~~~~ The exact output follows: Dec 24, 2015 11:29:01 AM com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify WARNING: Obsolete content type encountered: 'application/x-javascript'. Dec 24, 2015 11:29:01 AM com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify WARNING: Obsolete content type encountered: 'text/javascript'. Dec 24, 2015 11:29:01 AM com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify WARNING: Obsolete content type encountered: 'text/javascript'. Dec 24, 2015 11:29:02 AM com.gargoylesoftware.htmlunit.html.HtmlPage loadExternalJavaScriptFile SEVERE: Error loading JavaScript from [http://www.google-analytics.com/analytics.js]. org.apache.http.conn.HttpHostConnectException: Connect to www.google-analytics.com:80 [www.google-analytics.com/127.0.0.1] failed: Connection refused: connect at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:151) at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:353) at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:380) at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236) at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184) at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88) at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110) at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184) at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:71) at com.gargoylesoftware.htmlunit.HttpWebConnection.getResponse(HttpWebConnection.java:177) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseFromWebConnection(WebClient.java:1324) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponse(WebClient.java:1241) at com.gargoylesoftware.htmlunit.html.HtmlPage.loadJavaScriptFromUrl(HtmlPage.java:1031) at com.gargoylesoftware.htmlunit.html.HtmlPage.loadExternalJavaScriptFile(HtmlPage.java:974) at com.gargoylesoftware.htmlunit.html.HtmlScript.executeScriptIfNeeded(HtmlScript.java:399) at com.gargoylesoftware.htmlunit.html.HtmlScript$3.execute(HtmlScript.java:277) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.doProcessPostponedActions(JavaScriptEngine.java:1002) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.access$500(JavaScriptEngine.java:103) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:949) at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:628) at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:513) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:836) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:812) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:800) at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptIfPossible(HtmlPage.java:910) at com.gargoylesoftware.htmlunit.html.HtmlScript.executeInlineScriptIfNeeded(HtmlScript.java:354) at com.gargoylesoftware.htmlunit.html.HtmlScript.executeScriptIfNeeded(HtmlScript.java:415) at com.gargoylesoftware.htmlunit.html.HtmlScript$3.execute(HtmlScript.java:277) at com.gargoylesoftware.htmlunit.html.HtmlScript.onAllChildrenAddedToPage(HtmlScript.java:293) at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:799) at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source) at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:756) 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:1039) at com.gargoylesoftware.htmlunit.html.HTMLParser.parse(HTMLParser.java:252) at com.gargoylesoftware.htmlunit.html.HTMLParser.parseHtml(HTMLParser.java:198) at com.gargoylesoftware.htmlunit.DefaultPageCreator.createHtmlPage(DefaultPageCreator.java:271) at com.gargoylesoftware.htmlunit.DefaultPageCreator.createPage(DefaultPageCreator.java:159) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:478) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:352) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:417) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:402) at my.LJExport.Test.testHtmlUnit(Test.java:17) at my.LJExport.Main.main(Main.java:54) Caused by: java.net.ConnectException: Connection refused: connect at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method) at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:85) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at java.net.Socket.connect(Socket.java:579) at org.apache.http.conn.socket.PlainConnectionSocketFactory.connectSocket(PlainConnectionSocketFactory.java:74) at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:134) ... 52 more Dec 24, 2015 11:29:02 AM com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify WARNING: Obsolete content type encountered: 'application/x-javascript'. Dec 24, 2015 11:29:03 AM com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify WARNING: Obsolete content type encountered: 'application/x-javascript'. Dec 24, 2015 11:29:04 AM com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify WARNING: Obsolete content type encountered: 'application/x-javascript'. Dec 24, 2015 11:29:04 AM com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify WARNING: Obsolete content type encountered: 'application/x-javascript'. Dec 24, 2015 11:29:05 AM com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify WARNING: Obsolete content type encountered: 'application/x-javascript'. Dec 24, 2015 11:29:05 AM com.gargoylesoftware.htmlunit.html.HtmlScript isExecutionNeeded WARNING: Script is not JavaScript (type: text/ng-template, language: ). Skipping execution. Dec 24, 2015 11:29:05 AM com.gargoylesoftware.htmlunit.html.HtmlScript isExecutionNeeded WARNING: Script is not JavaScript (type: text/html, language: ). Skipping execution. Dec 24, 2015 11:29:05 AM com.gargoylesoftware.htmlunit.html.HtmlScript isExecutionNeeded WARNING: Script is not JavaScript (type: text/ng-template, language: ). Skipping execution. Dec 24, 2015 11:29:05 AM com.gargoylesoftware.htmlunit.html.HtmlScript isExecutionNeeded WARNING: Script is not JavaScript (type: text/ng-template, language: ). Skipping execution. Dec 24, 2015 11:29:05 AM com.gargoylesoftware.htmlunit.html.HtmlScript isExecutionNeeded WARNING: Script is not JavaScript (type: text/ng-template, language: ). Skipping execution. Dec 24, 2015 11:29:06 AM com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify WARNING: Obsolete content type encountered: 'application/x-javascript'. *** Exception: TypeError: Expected argument of type object, but instead had type object (http://l-stat.livejournal.net/js/??.ljlib.js?v=1450784615#19) ======= EXCEPTION START ======== EcmaError: lineNumber=[19] column=[0] lineSource=[<no source>] name=[TypeError] sourceName=[http://l-stat.livejournal.net/js/??.ljlib.js?v=1450784615] message=[TypeError: Expected argument of type object, but instead had type object (http://l-stat.livejournal.net/js/??.ljlib.js?v=1450784615#19)] com.gargoylesoftware.htmlunit.ScriptException: TypeError: Expected argument of type object, but instead had type object (http://l-stat.livejournal.net/js/??.ljlib.js?v=1450784615#19) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:954) at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:628) at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:513) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:836) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:812) at com.gargoylesoftware.htmlunit.html.HtmlPage.loadExternalJavaScriptFile(HtmlPage.java:997) at com.gargoylesoftware.htmlunit.html.HtmlScript.executeScriptIfNeeded(HtmlScript.java:399) at com.gargoylesoftware.htmlunit.html.HtmlScript$3.execute(HtmlScript.java:277) at com.gargoylesoftware.htmlunit.html.HtmlScript.onAllChildrenAddedToPage(HtmlScript.java:293) at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:799) at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source) at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:756) 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:1039) at com.gargoylesoftware.htmlunit.html.HTMLParser.parse(HTMLParser.java:252) at com.gargoylesoftware.htmlunit.html.HTMLParser.parseHtml(HTMLParser.java:198) at com.gargoylesoftware.htmlunit.DefaultPageCreator.createHtmlPage(DefaultPageCreator.java:271) at com.gargoylesoftware.htmlunit.DefaultPageCreator.createPage(DefaultPageCreator.java:159) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:478) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:352) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:417) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:402) at my.LJExport.Test.testHtmlUnit(Test.java:17) at my.LJExport.Main.main(Main.java:54) Caused by: net.sourceforge.htmlunit.corejs.javascript.EcmaError: TypeError: Expected argument of type object, but instead had type object (http://l-stat.livejournal.net/js/??.ljlib.js?v=1450784615#19) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3935) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3919) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3944) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.typeError1(ScriptRuntime.java:3954) at net.sourceforge.htmlunit.corejs.javascript.ScriptableObject.ensureScriptableObject(ScriptableObject.java:2193) at net.sourceforge.htmlunit.corejs.javascript.NativeObject.execIdCall(NativeObject.java:303) at net.sourceforge.htmlunit.corejs.javascript.IdFunctionObject.call(IdFunctionObject.java:93) at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpretLoop(Interpreter.java:1536) 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:3286) at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.exec(InterpretedFunction.java:115) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$3.doRun(JavaScriptEngine.java:827) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:939) ... 32 more Enclosed exception: net.sourceforge.htmlunit.corejs.javascript.EcmaError: TypeError: Expected argument of type object, but instead had type object (http://l-stat.livejournal.net/js/??.ljlib.js?v=1450784615#19) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3935) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3919) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3944) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.typeError1(ScriptRuntime.java:3954) at net.sourceforge.htmlunit.corejs.javascript.ScriptableObject.ensureScriptableObject(ScriptableObject.java:2193) at net.sourceforge.htmlunit.corejs.javascript.NativeObject.execIdCall(NativeObject.java:303) at net.sourceforge.htmlunit.corejs.javascript.IdFunctionObject.call(IdFunctionObject.java:93) at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpretLoop(Interpreter.java:1536) at script(http://l-stat.livejournal.net/js/??.ljlib.js?v=1450784615:19) at script.o(http://l-stat.livejournal.net/js/??.ljlib.js?v=1450784615:19) at script(http://l-stat.livejournal.net/js/??.ljlib.js?v=1450784615:19) at script(http://l-stat.livejournal.net/js/??.ljlib.js?v=1450784615:20) at script.o(http://l-stat.livejournal.net/js/??.ljlib.js?v=1450784615:19) at script(http://l-stat.livejournal.net/js/??.ljlib.js?v=1450784615:19) at script(http://l-stat.livejournal.net/js/??.ljlib.js?v=1450784615:20) at script.o(http://l-stat.livejournal.net/js/??.ljlib.js?v=1450784615:19) at script(http://l-stat.livejournal.net/js/??.ljlib.js?v=1450784615:19) at script(http://l-stat.livejournal.net/js/??.ljlib.js?v=1450784615:19) at script(http://l-stat.livejournal.net/js/??.ljlib.js?v=1450784615:19) at script.o(http://l-stat.livejournal.net/js/??.ljlib.js?v=1450784615:19) at script.t(http://l-stat.livejournal.net/js/??.ljlib.js?v=1450784615:19) at script(http://l-stat.livejournal.net/js/??.ljlib.js?v=1450784615:19) 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:3286) at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.exec(InterpretedFunction.java:115) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$3.doRun(JavaScriptEngine.java:827) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:939) at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:628) at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:513) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:836) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:812) at com.gargoylesoftware.htmlunit.html.HtmlPage.loadExternalJavaScriptFile(HtmlPage.java:997) at com.gargoylesoftware.htmlunit.html.HtmlScript.executeScriptIfNeeded(HtmlScript.java:399) at com.gargoylesoftware.htmlunit.html.HtmlScript$3.execute(HtmlScript.java:277) at com.gargoylesoftware.htmlunit.html.HtmlScript.onAllChildrenAddedToPage(HtmlScript.java:293) at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:799) at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source) at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:756) 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:1039) at com.gargoylesoftware.htmlunit.html.HTMLParser.parse(HTMLParser.java:252) at com.gargoylesoftware.htmlunit.html.HTMLParser.parseHtml(HTMLParser.java:198) at com.gargoylesoftware.htmlunit.DefaultPageCreator.createHtmlPage(DefaultPageCreator.java:271) at com.gargoylesoftware.htmlunit.DefaultPageCreator.createPage(DefaultPageCreator.java:159) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:478) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:352) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:417) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:402) at my.LJExport.Test.testHtmlUnit(Test.java:17) at my.LJExport.Main.main(Main.java:54) ======= EXCEPTION END ======== --- Sent from sourceforge.net because htm...@li... is subscribed to https://sourceforge.net/p/htmlunit/bugs/ To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/htmlunit/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list. |
From: <rb...@us...> - 2018-07-22 17:37:14
|
Revision: 15494 http://sourceforge.net/p/htmlunit/code/15494 Author: rbri Date: 2018-07-22 17:37:11 +0000 (Sun, 22 Jul 2018) Log Message: ----------- use neko 2.32 release Modified Paths: -------------- trunk/htmlunit/pom.xml Modified: trunk/htmlunit/pom.xml =================================================================== --- trunk/htmlunit/pom.xml 2018-07-22 11:56:18 UTC (rev 15493) +++ trunk/htmlunit/pom.xml 2018-07-22 17:37:11 UTC (rev 15494) @@ -864,7 +864,7 @@ <dependency> <groupId>net.sourceforge.htmlunit</groupId> <artifactId>neko-htmlunit</artifactId> - <version>2.31</version> + <version>2.32</version> </dependency> <dependency> <groupId>net.sourceforge.htmlunit</groupId> |
From: <rb...@us...> - 2018-07-22 11:56:20
|
Revision: 15493 http://sourceforge.net/p/htmlunit/code/15493 Author: rbri Date: 2018-07-22 11:56:18 +0000 (Sun, 22 Jul 2018) Log Message: ----------- use cssparser 1.1.0 Modified Paths: -------------- trunk/htmlunit/pom.xml Modified: trunk/htmlunit/pom.xml =================================================================== --- trunk/htmlunit/pom.xml 2018-07-21 14:40:55 UTC (rev 15492) +++ trunk/htmlunit/pom.xml 2018-07-22 11:56:18 UTC (rev 15493) @@ -869,7 +869,7 @@ <dependency> <groupId>net.sourceforge.htmlunit</groupId> <artifactId>htmlunit-cssparser</artifactId> - <version>1.1.0-SNAPSHOT</version> + <version>1.1.0</version> </dependency> <dependency> <groupId>commons-io</groupId> |
From: RBRi <rb...@us...> - 2018-07-21 16:08:19
|
As a reminder for myself https://stackoverflow.com/questions/1540424/java-proxy-client-class-that-supports-authentication --- ** [bugs:#1960] Authenticated SOCKS5 with username/password does not work** **Status:** open **Group:** 2.30 **Labels:** socks socks5 authentication **Created:** Tue Apr 03, 2018 07:27 AM UTC by Rahul Vaidya **Last Updated:** Tue Apr 03, 2018 05:58 PM UTC **Owner:** nobody I am using this to set up my proxy connection: client.getOptions().setProxyConfig(new ProxyConfig(host, port, true)); DefaultCredentialsProvider credentialsProvider = (DefaultCredentialsProvider) client.getCredentialsProvider(); credentialsProvider.addCredentials(username, password); When I try to connect I get this: [main] INFO org.apache.http.impl.execchain.RetryExec - I/O exception (java.net.SocketException) caught when processing request to {}->http://checkip.amazonaws.com:80: SOCKS : authentication failed [main] INFO org.apache.http.impl.execchain.RetryExec - Retrying request to {}->http://checkip.amazonaws.com:80 [main] INFO org.apache.http.impl.execchain.RetryExec - I/O exception (java.net.SocketException) caught when processing request to {}->http://checkip.amazonaws.com:80: SOCKS : authentication failed [main] INFO org.apache.http.impl.execchain.RetryExec - Retrying request to {}->http://checkip.amazonaws.com:80 [main] INFO org.apache.http.impl.execchain.RetryExec - I/O exception (java.net.SocketException) caught when processing request to {}->http://checkip.amazonaws.com:80: SOCKS : authentication failed [main] INFO org.apache.http.impl.execchain.RetryExec - Retrying request to {}->http://checkip.amazonaws.com:80 Error getting web client IP address java.net.SocketException: SOCKS : authentication failed at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:473) at java.net.Socket.connect(Socket.java:589) at org.apache.http.conn.socket.PlainConnectionSocketFactory.connectSocket(PlainConnectionSocketFactory.java:74) at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:141) at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:353) at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:380) at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236) at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184) at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88) at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110) at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184) at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:71) at com.gargoylesoftware.htmlunit.HttpWebConnection.getResponse(HttpWebConnection.java:192) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseFromWebConnection(WebClient.java:1401) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponse(WebClient.java:1319) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:394) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:315) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:463) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:448) --- Sent from sourceforge.net because htm...@li... is subscribed to https://sourceforge.net/p/htmlunit/bugs/ To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/htmlunit/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list. |
From: <rb...@us...> - 2018-07-21 14:40:58
|
Revision: 15492 http://sourceforge.net/p/htmlunit/code/15492 Author: rbri Date: 2018-07-21 14:40:55 +0000 (Sat, 21 Jul 2018) Log Message: ----------- code style Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2018-07-21 12:36:53 UTC (rev 15491) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2018-07-21 14:40:55 UTC (rev 15492) @@ -624,7 +624,7 @@ } /** - * special setter for IE to ignore this call. + * Special setter for IE to ignore this call. * @param ignore parame gets ignored */ @JsxSetter(IE) |
From: <rb...@us...> - 2018-07-21 12:37:14
|
Revision: 15491 http://sourceforge.net/p/htmlunit/code/15491 Author: rbri Date: 2018-07-21 12:36:53 +0000 (Sat, 21 Jul 2018) Log Message: ----------- setting window.clientInformation is ignored in IE Modified Paths: -------------- trunk/htmlunit/src/changes/changes.xml trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/Window2Test.java Modified: trunk/htmlunit/src/changes/changes.xml =================================================================== --- trunk/htmlunit/src/changes/changes.xml 2018-07-21 12:09:18 UTC (rev 15490) +++ trunk/htmlunit/src/changes/changes.xml 2018-07-21 12:36:53 UTC (rev 15491) @@ -8,6 +8,9 @@ <body> <release version="2.32" date="xx 2018" description="Bugfixes, FIREFOX_45 removed, FIREFOX_60 added"> + <action type="fix" dev="rbri"> + Setting window.clientInformation is ignored in IE. + </action> <action type="fix" dev="rbri" issue="1969"> HTMLxxxInput.reset() results in a wrong state of the selection delegate. </action> Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2018-07-21 12:09:18 UTC (rev 15490) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2018-07-21 12:36:53 UTC (rev 15491) @@ -624,6 +624,14 @@ } /** + * special setter for IE to ignore this call. + * @param ignore parame gets ignored + */ + @JsxSetter(IE) + public void setClientInformation(final Object ignore) { + } + + /** * Returns the JavaScript property {@code clipboardData}. * @return the {@link DataTransfer} */ Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/Window2Test.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/Window2Test.java 2018-07-21 12:09:18 UTC (rev 15490) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/Window2Test.java 2018-07-21 12:36:53 UTC (rev 15491) @@ -2385,4 +2385,25 @@ loadPageWithAlerts2(html); } + /** + * @throws Exception if an error occurs + */ + @Test + @Alerts(DEFAULT = {"[object Navigator]", "##test##"}, + IE = {"[object Navigator]", "[object Navigator]"}, + FF = {"undefined", "##test##"}) + public void clientInformation() throws Exception { + final String html = "<html><head>\n" + + "<script>\n" + + " function test() {\n" + + " alert(window.clientInformation);\n" + + " window.clientInformation = '##test##';\n" + + " alert(window.clientInformation);\n" + + " }\n" + + "</script>\n" + + "</head>\n" + + "<body onload='test()'>\n" + + "</body></html>"; + loadPageWithAlerts2(html); + } } |
From: RBRi <rb...@us...> - 2018-07-21 12:13:09
|
- **status**: open --> pending - **assigned_to**: RBRi - **Comment**: Hi Alex, can you please provide a simple sample to make you point clear. I think there is already support for this but maybe i'm wrong or i miss something. --- ** [bugs:#1968] Function.prototype.toString shall return actual source code** **Status:** pending **Group:** 2.31 **Created:** Sun Jun 17, 2018 11:49 AM UTC by Alex **Last Updated:** Sun Jun 17, 2018 11:49 AM UTC **Owner:** RBRi Some scripts make use of Function.prototype.toString and rely on it beeing the original source code especially newlines. This is due to some pattern matching done later via regexp. This breaks with the unparsing/decompiling that HTMLUNIT does. I therefore propose to store the original JS source and directly return it. This is the same as browsers do. Example: https://bugzilla.mozilla.org/show_bug.cgi?id=761723 --- Sent from sourceforge.net because htm...@li... is subscribed to https://sourceforge.net/p/htmlunit/bugs/ To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/htmlunit/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list. |
From: RBRi <rb...@us...> - 2018-07-21 12:11:08
|
- **status**: open --> closed - **assigned_to**: RBRi --- ** [bugs:#1969] HTMLTelInput & HTMLUnitDriver - Cannot clear field and enter a new value** **Status:** closed **Group:** 2.31 **Labels:** HtmlUnitDriver HtmlUnit **Created:** Tue Jun 19, 2018 12:59 AM UTC by Tomer Kimia **Last Updated:** Sat Jul 21, 2018 12:10 PM UTC **Owner:** RBRi I'm encountering an easily reproducible error using `HTMLTelInput`: ``` //assume telInputField is a valid field HtmlInput telInputField = form.getInputByName("zipCode"); telInputField.type("91210"); telInputField.reset(); telInputField.type("90210"); ``` I originally encountered this using the `HTMLUnitDriver` through selenium. --- Sent from sourceforge.net because htm...@li... is subscribed to https://sourceforge.net/p/htmlunit/bugs/ To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/htmlunit/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list. |
From: RBRi <rb...@us...> - 2018-07-21 12:10:52
|
Yes, correct; another stupid bug related to the selection delegate. Same issue for other input elements. This is fixed now in SVN, have a look at [Twitter](https://twitter.com/HtmlUnit) to get informed about the next snapshot (and release). --- ** [bugs:#1969] HTMLTelInput & HTMLUnitDriver - Cannot clear field and enter a new value** **Status:** open **Group:** 2.31 **Labels:** HtmlUnitDriver HtmlUnit **Created:** Tue Jun 19, 2018 12:59 AM UTC by Tomer Kimia **Last Updated:** Tue Jun 19, 2018 12:59 AM UTC **Owner:** nobody I'm encountering an easily reproducible error using `HTMLTelInput`: ``` //assume telInputField is a valid field HtmlInput telInputField = form.getInputByName("zipCode"); telInputField.type("91210"); telInputField.reset(); telInputField.type("90210"); ``` I originally encountered this using the `HTMLUnitDriver` through selenium. --- Sent from sourceforge.net because htm...@li... is subscribed to https://sourceforge.net/p/htmlunit/bugs/ To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/htmlunit/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list. |
From: <rb...@us...> - 2018-07-21 12:09:22
|
Revision: 15490 http://sourceforge.net/p/htmlunit/code/15490 Author: rbri Date: 2018-07-21 12:09:18 +0000 (Sat, 21 Jul 2018) Log Message: ----------- HTMLxxxInput.reset() results in a wrong state of the selection delegate Issue 1969 Modified Paths: -------------- trunk/htmlunit/src/changes/changes.xml trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlEmailInput.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlNumberInput.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlPasswordInput.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTelInput.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTextArea.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTextInput.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlUrlInput.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlEmailInput2Test.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlNumberInput2Test.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlPasswordInput2Test.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlTelInput2Test.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlTextAreaTest.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlTextInput2Test.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlUrlInput2Test.java Modified: trunk/htmlunit/src/changes/changes.xml =================================================================== --- trunk/htmlunit/src/changes/changes.xml 2018-07-19 19:07:50 UTC (rev 15489) +++ trunk/htmlunit/src/changes/changes.xml 2018-07-21 12:09:18 UTC (rev 15490) @@ -8,6 +8,9 @@ <body> <release version="2.32" date="xx 2018" description="Bugfixes, FIREFOX_45 removed, FIREFOX_60 added"> + <action type="fix" dev="rbri" issue="1969"> + HTMLxxxInput.reset() results in a wrong state of the selection delegate. + </action> <action type="add" dev="rbri"> FF60 ESR support. </action> Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlEmailInput.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlEmailInput.java 2018-07-19 19:07:50 UTC (rev 15489) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlEmailInput.java 2018-07-21 12:09:18 UTC (rev 15490) @@ -156,8 +156,18 @@ /** * {@inheritDoc} + * @see HtmlInput#reset() */ @Override + public void reset() { + super.reset(); + setSelectionEnd(0); + } + + /** + * {@inheritDoc} + */ + @Override public DomNode cloneNode(final boolean deep) { final HtmlEmailInput newnode = (HtmlEmailInput) super.cloneNode(deep); newnode.selectionDelegate_ = new SelectableTextSelectionDelegate(newnode); Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlNumberInput.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlNumberInput.java 2018-07-19 19:07:50 UTC (rev 15489) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlNumberInput.java 2018-07-21 12:09:18 UTC (rev 15490) @@ -174,14 +174,6 @@ * {@inheritDoc} */ @Override - protected Object clone() throws CloneNotSupportedException { - return new HtmlNumberInput(getQualifiedName(), getPage(), getAttributesMap()); - } - - /** - * {@inheritDoc} - */ - @Override public void setDefaultValue(final String defaultValue) { final boolean modifyValue = getValueAttribute().equals(getDefaultValue()); setDefaultValue(defaultValue, modifyValue); @@ -205,8 +197,18 @@ /** * {@inheritDoc} + * @see HtmlInput#reset() */ @Override + public void reset() { + super.reset(); + setSelectionEnd(0); + } + + /** + * {@inheritDoc} + */ + @Override public DomNode cloneNode(final boolean deep) { final HtmlNumberInput newnode = (HtmlNumberInput) super.cloneNode(deep); newnode.selectionDelegate_ = new SelectableTextSelectionDelegate(newnode); Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlPasswordInput.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlPasswordInput.java 2018-07-19 19:07:50 UTC (rev 15489) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlPasswordInput.java 2018-07-21 12:09:18 UTC (rev 15490) @@ -158,14 +158,6 @@ * {@inheritDoc} */ @Override - protected Object clone() throws CloneNotSupportedException { - return new HtmlPasswordInput(getQualifiedName(), getPage(), getAttributesMap()); - } - - /** - * {@inheritDoc} - */ - @Override protected void setAttributeNS(final String namespaceURI, final String qualifiedName, final String attributeValue, final boolean notifyAttributeChangeListeners, final boolean notifyMutationObservers) { super.setAttributeNS(namespaceURI, qualifiedName, attributeValue, notifyAttributeChangeListeners, @@ -194,8 +186,18 @@ /** * {@inheritDoc} + * @see HtmlInput#reset() */ @Override + public void reset() { + super.reset(); + setSelectionEnd(0); + } + + /** + * {@inheritDoc} + */ + @Override public DomNode cloneNode(final boolean deep) { final HtmlPasswordInput newnode = (HtmlPasswordInput) super.cloneNode(deep); newnode.selectionDelegate_ = new SelectableTextSelectionDelegate(newnode); Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTelInput.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTelInput.java 2018-07-19 19:07:50 UTC (rev 15489) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTelInput.java 2018-07-21 12:09:18 UTC (rev 15490) @@ -150,4 +150,14 @@ return newnode; } + + /** + * {@inheritDoc} + * @see HtmlInput#reset() + */ + @Override + public void reset() { + super.reset(); + setSelectionEnd(0); + } } Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTextArea.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTextArea.java 2018-07-19 19:07:50 UTC (rev 15489) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTextArea.java 2018-07-21 12:09:18 UTC (rev 15490) @@ -544,14 +544,6 @@ * {@inheritDoc} */ @Override - protected Object clone() throws CloneNotSupportedException { - return new HtmlTextArea(getQualifiedName(), getPage(), getAttributesMap()); - } - - /** - * {@inheritDoc} - */ - @Override protected void setAttributeNS(final String namespaceURI, final String qualifiedName, final String attributeValue, final boolean notifyAttributeChangeListeners, final boolean notifyMutationObservers) { if ("name".equals(qualifiedName)) { Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTextInput.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTextInput.java 2018-07-19 19:07:50 UTC (rev 15489) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTextInput.java 2018-07-21 12:09:18 UTC (rev 15490) @@ -180,17 +180,19 @@ * {@inheritDoc} */ @Override - protected Object clone() throws CloneNotSupportedException { - return new HtmlTextInput(getQualifiedName(), getPage(), getAttributesMap()); + public void setDefaultValue(final String defaultValue) { + final boolean modifyValue = getValueAttribute().equals(getDefaultValue()); + setDefaultValue(defaultValue, modifyValue); } /** * {@inheritDoc} + * @see HtmlInput#reset() */ @Override - public void setDefaultValue(final String defaultValue) { - final boolean modifyValue = getValueAttribute().equals(getDefaultValue()); - setDefaultValue(defaultValue, modifyValue); + public void reset() { + super.reset(); + setSelectionEnd(0); } /** Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlUrlInput.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlUrlInput.java 2018-07-19 19:07:50 UTC (rev 15489) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlUrlInput.java 2018-07-21 12:09:18 UTC (rev 15490) @@ -156,8 +156,18 @@ /** * {@inheritDoc} + * @see HtmlInput#reset() */ @Override + public void reset() { + super.reset(); + setSelectionEnd(0); + } + + /** + * {@inheritDoc} + */ + @Override public DomNode cloneNode(final boolean deep) { final HtmlUrlInput newnode = (HtmlUrlInput) super.cloneNode(deep); newnode.selectionDelegate_ = new SelectableTextSelectionDelegate(newnode); Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlEmailInput2Test.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlEmailInput2Test.java 2018-07-19 19:07:50 UTC (rev 15489) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlEmailInput2Test.java 2018-07-21 12:09:18 UTC (rev 15490) @@ -49,4 +49,29 @@ input.type("ab...@em..."); assertEquals("ab...@em...", input.getValueAttribute()); } + + /** + * @throws Exception if the test fails + */ + @Test + public void typingAndReset() throws Exception { + final String htmlContent + = "<html>\n" + + "<head></head>\n" + + "<body>\n" + + "<form id='form1'>\n" + + " <input type='email' id='foo'>\n" + + "</form>\n" + + "</body></html>"; + + final HtmlPage page = loadPage(htmlContent); + + final HtmlEmailInput input = (HtmlEmailInput) page.getElementById("foo"); + + input.type("ab...@em..."); + input.reset(); + input.type("xy...@em..."); + + assertEquals("xy...@em...", input.getValueAttribute()); + } } Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlNumberInput2Test.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlNumberInput2Test.java 2018-07-19 19:07:50 UTC (rev 15489) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlNumberInput2Test.java 2018-07-21 12:09:18 UTC (rev 15490) @@ -49,4 +49,29 @@ input.type("4711"); assertEquals("4711", input.getValueAttribute()); } + + /** + * @throws Exception if the test fails + */ + @Test + public void typingAndReset() throws Exception { + final String htmlContent + = "<html>\n" + + "<head></head>\n" + + "<body>\n" + + "<form id='form1'>\n" + + " <input type='number' id='foo'>\n" + + "</form>\n" + + "</body></html>"; + + final HtmlPage page = loadPage(htmlContent); + + final HtmlNumberInput input = (HtmlNumberInput) page.getElementById("foo"); + + input.type("4711"); + input.reset(); + input.type("0815"); + + assertEquals("0815", input.getValueAttribute()); + } } Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlPasswordInput2Test.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlPasswordInput2Test.java 2018-07-19 19:07:50 UTC (rev 15489) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlPasswordInput2Test.java 2018-07-21 12:09:18 UTC (rev 15490) @@ -107,4 +107,29 @@ input.type("4711"); assertEquals("4711", input.getValueAttribute()); } + + /** + * @throws Exception if the test fails + */ + @Test + public void typingAndReset() throws Exception { + final String htmlContent + = "<html>\n" + + "<head></head>\n" + + "<body>\n" + + "<form id='form1'>\n" + + " <input type='password' id='foo'>\n" + + "</form>\n" + + "</body></html>"; + + final HtmlPage page = loadPage(htmlContent); + + final HtmlPasswordInput input = (HtmlPasswordInput) page.getElementById("foo"); + + input.type("4711"); + input.reset(); + input.type("0815"); + + assertEquals("0815", input.getValueAttribute()); + } } Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlTelInput2Test.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlTelInput2Test.java 2018-07-19 19:07:50 UTC (rev 15489) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlTelInput2Test.java 2018-07-21 12:09:18 UTC (rev 15490) @@ -49,4 +49,29 @@ input.type("4711"); assertEquals("4711", input.getValueAttribute()); } + + /** + * @throws Exception if the test fails + */ + @Test + public void typingAndReset() throws Exception { + final String htmlContent + = "<html>\n" + + "<head></head>\n" + + "<body>\n" + + "<form id='form1'>\n" + + " <input type='tel' id='foo'>\n" + + "</form>\n" + + "</body></html>"; + + final HtmlPage page = loadPage(htmlContent); + + final HtmlTelInput input = (HtmlTelInput) page.getElementById("foo"); + + input.type("4711"); + input.reset(); + input.type("0815"); + + assertEquals("0815", input.getValueAttribute()); + } } Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlTextAreaTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlTextAreaTest.java 2018-07-19 19:07:50 UTC (rev 15489) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlTextAreaTest.java 2018-07-21 12:09:18 UTC (rev 15490) @@ -292,4 +292,51 @@ final HtmlTextArea t = page.getHtmlElementById("t"); t.removeFocus(); } + + /** + * @throws Exception if the test fails + */ + @Test + public void typingAndClone() throws Exception { + final String htmlContent + = "<html>\n" + + "<head></head>\n" + + "<body>\n" + + "<form id='form1'>\n" + + " <textarea id='foo'></textarea>\n" + + "</form>\n" + + "</body></html>"; + + final HtmlPage page = loadPage(htmlContent); + + HtmlTextArea input = (HtmlTextArea) page.getElementById("foo"); + input = (HtmlTextArea) input.cloneNode(true); + input.type("4711"); + assertEquals("4711", input.getTextContent()); + } + + /** + * @throws Exception if the test fails + */ + @Test + public void typingAndReset() throws Exception { + final String htmlContent + = "<html>\n" + + "<head></head>\n" + + "<body>\n" + + "<form id='form1'>\n" + + " <textarea id='foo'></textarea>\n" + + "</form>\n" + + "</body></html>"; + + final HtmlPage page = loadPage(htmlContent); + + final HtmlTextArea input = (HtmlTextArea) page.getElementById("foo"); + + input.type("4711"); + input.reset(); + input.type("0815"); + + assertEquals("0815", input.getTextContent()); + } } Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlTextInput2Test.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlTextInput2Test.java 2018-07-19 19:07:50 UTC (rev 15489) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlTextInput2Test.java 2018-07-21 12:09:18 UTC (rev 15490) @@ -360,4 +360,51 @@ assertEquals(1, getMockWebConnection().getRequestCount()); } + + /** + * @throws Exception if the test fails + */ + @Test + public void typingAndClone() throws Exception { + final String htmlContent + = "<html>\n" + + "<head></head>\n" + + "<body>\n" + + "<form id='form1'>\n" + + " <input id='foo'>\n" + + "</form>\n" + + "</body></html>"; + + final HtmlPage page = loadPage(htmlContent); + + HtmlTextInput input = (HtmlTextInput) page.getElementById("foo"); + input = (HtmlTextInput) input.cloneNode(true); + input.type("4711"); + assertEquals("4711", input.getValueAttribute()); + } + + /** + * @throws Exception if the test fails + */ + @Test + public void typingAndReset() throws Exception { + final String htmlContent + = "<html>\n" + + "<head></head>\n" + + "<body>\n" + + "<form id='form1'>\n" + + " <input id='foo'>\n" + + "</form>\n" + + "</body></html>"; + + final HtmlPage page = loadPage(htmlContent); + + final HtmlTextInput input = (HtmlTextInput) page.getElementById("foo"); + + input.type("4711"); + input.reset(); + input.type("0815"); + + assertEquals("0815", input.getValueAttribute()); + } } Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlUrlInput2Test.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlUrlInput2Test.java 2018-07-19 19:07:50 UTC (rev 15489) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlUrlInput2Test.java 2018-07-21 12:09:18 UTC (rev 15490) @@ -49,4 +49,29 @@ input.type("4711"); assertEquals("4711", input.getValueAttribute()); } + + /** + * @throws Exception if the test fails + */ + @Test + public void typingAndReset() throws Exception { + final String htmlContent + = "<html>\n" + + "<head></head>\n" + + "<body>\n" + + "<form id='form1'>\n" + + " <input type='url' id='foo'>\n" + + "</form>\n" + + "</body></html>"; + + final HtmlPage page = loadPage(htmlContent); + + final HtmlUrlInput input = (HtmlUrlInput) page.getElementById("foo"); + + input.type("4711"); + input.reset(); + input.type("0815"); + + assertEquals("0815", input.getValueAttribute()); + } } |
From: rbri <rb...@rb...> - 2018-07-21 09:25:48
|
Branch: refs/heads/master Home: https://github.com/HtmlUnit/htmlunit-core-js Commit: 830e6c31f5983ce4a878dd56ea3f3e36283ec1e0 https://github.com/HtmlUnit/htmlunit-core-js/commit/830e6c31f5983ce4a878dd56ea3f3e36283ec1e0 Author: rbri <rb...@rb...> Date: 2018-07-21 (Sat, 21 Jul 2018) Changed paths: M build.gradle R pom.xml Log Message: ----------- create manifest; pom will be created by gradle **NOTE:** This service been marked for deprecation: https://developer.github.com/changes/2018-04-25-github-services-deprecation/ Functionality will be removed from GitHub.com on January 31st, 2019. |
From: rbri <rb...@rb...> - 2018-07-21 09:21:53
|
Branch: refs/heads/master Home: https://github.com/HtmlUnit/htmlunit-rhino-fork Commit: f192525fa96ad2c1211ec984e300e475bf7e4bb6 https://github.com/HtmlUnit/htmlunit-rhino-fork/commit/f192525fa96ad2c1211ec984e300e475bf7e4bb6 Author: Sébastien Doeraene <sjr...@gm...> Date: 2018-06-29 (Fri, 29 Jun 2018) Changed paths: M src/org/mozilla/javascript/NativeMath.java M testsrc/test262.properties Log Message: ----------- Fix #448: Correctly wrap the result of Math.imul as an Int32. As an added bonus, return an `int` from `js_imul` to avoid boxing. At call site, it is assigned to a `double`, not an `Object`, so eagerly boxing the result inside `js_imul` is counter-productive. Commit: 66da45a02fa7a53dbb7f4f312b2228919044ea58 https://github.com/HtmlUnit/htmlunit-rhino-fork/commit/66da45a02fa7a53dbb7f4f312b2228919044ea58 Author: Sébastien Doeraene <sjr...@gm...> Date: 2018-07-02 (Mon, 02 Jul 2018) Changed paths: M src/org/mozilla/javascript/typedarrays/Conversions.java M testsrc/test262.properties Log Message: ----------- Fix the conversions in typedarrays.Conversions. Their implementation did not account for a) the wrapping of number values larger than Integer.MAX_VALUE or lower than Integer.MIN_VALUE. b) the behavior of `%` for negative values. The complex problem of a) is already dealt with by `ScriptRuntime.toInt32`, which we now leverage. Instead of `%` to implement the `modulo` operation from the ECMAScript specification (which is incorrect), we use sign-extending conversions such as `(int)(byte)x` and bitwise ands such as `& 0xff`. This fixes the test262 test in `built-ins/TypedArrays/internals/Set/conversion-operation.js`. Commit: 741ef520c83e933361b174f9c6a41f0c3f187299 https://github.com/HtmlUnit/htmlunit-rhino-fork/commit/741ef520c83e933361b174f9c6a41f0c3f187299 Author: rbri <rb...@rb...> Date: 2018-07-02 (Mon, 02 Jul 2018) Changed paths: M testsrc/test262.properties Log Message: ----------- we have many more 262 tests passing already - i think we have to use as many tests as possible to check our quality before: 45858 after: 49719 Commit: c5af11cb890909a7f95f2219ca2d5334b4bd41c5 https://github.com/HtmlUnit/htmlunit-rhino-fork/commit/c5af11cb890909a7f95f2219ca2d5334b4bd41c5 Author: rbri <rb...@rb...> Date: 2018-07-02 (Mon, 02 Jul 2018) Changed paths: M testsrc/test262.properties Log Message: ----------- and some more; now we are at 51093 Commit: 45be25338705a7a7e071f45ea56f420662d642a0 https://github.com/HtmlUnit/htmlunit-rhino-fork/commit/45be25338705a7a7e071f45ea56f420662d642a0 Author: rbri <rb...@rb...> Date: 2018-07-03 (Tue, 03 Jul 2018) Changed paths: M testsrc/test262.properties Log Message: ----------- Use as many test262 tests as possible to check our quality before: 45858 after: 51093 Commit: 2d89acb883576c0acc62ab4300da6c0029dc565d https://github.com/HtmlUnit/htmlunit-rhino-fork/commit/2d89acb883576c0acc62ab4300da6c0029dc565d Author: rbri <rb...@rb...> Date: 2018-07-03 (Tue, 03 Jul 2018) Changed paths: M src/org/mozilla/javascript/NativeMath.java M testsrc/test262.properties Log Message: ----------- implement missing Math functions Commit: 276c383c12b0c11dc94b9b0be17f693b36e4c8be https://github.com/HtmlUnit/htmlunit-rhino-fork/commit/276c383c12b0c11dc94b9b0be17f693b36e4c8be Author: rbri <rb...@rb...> Date: 2018-07-03 (Tue, 03 Jul 2018) Changed paths: M testsrc/test262.properties Log Message: ----------- disable some slow tests Commit: 47a2c3ac047502b12744e495b1cdf2d6bc0392b8 https://github.com/HtmlUnit/htmlunit-rhino-fork/commit/47a2c3ac047502b12744e495b1cdf2d6bc0392b8 Author: rbri <rb...@rb...> Date: 2018-07-09 (Mon, 09 Jul 2018) Changed paths: M src/org/mozilla/javascript/typedarrays/NativeTypedArrayView.java A testsrc/jstests/harmony/typed-array-ctor.js A testsrc/org/mozilla/javascript/tests/harmony/TypedArrayCtorTest.java Log Message: ----------- Support for `arguments` object as TypedArray constructor argument this is the same as #297 but includes a simple test. Commit: c16327b89baa8f051da1a21f506d3cfcf876577a https://github.com/HtmlUnit/htmlunit-rhino-fork/commit/c16327b89baa8f051da1a21f506d3cfcf876577a Author: Attila Szegedi <sze...@gm...> Date: 2018-07-12 (Thu, 12 Jul 2018) Changed paths: M src/org/mozilla/javascript/NativeContinuation.java Log Message: ----------- API for comparing continuation implementations Commit: 9bdfed1947781a3e68a0a4613c86dbceaca05798 https://github.com/HtmlUnit/htmlunit-rhino-fork/commit/9bdfed1947781a3e68a0a4613c86dbceaca05798 Author: Attila Szegedi <sze...@gm...> Date: 2018-07-12 (Thu, 12 Jul 2018) Changed paths: M src/org/mozilla/javascript/ArrowFunction.java M src/org/mozilla/javascript/BoundFunction.java A src/org/mozilla/javascript/EqualObjectGraphs.java M src/org/mozilla/javascript/IdFunctionObject.java A testsrc/org/mozilla/javascript/EqualObjectGraphsTest.java Log Message: ----------- Algorithm for structural equality comparison of object graphs Commit: 3c9f9537e4dd1374c1dc7209e9b926ac2cf035ad https://github.com/HtmlUnit/htmlunit-rhino-fork/commit/3c9f9537e4dd1374c1dc7209e9b926ac2cf035ad Author: Attila Szegedi <sze...@gm...> Date: 2018-07-12 (Thu, 12 Jul 2018) Changed paths: M src/org/mozilla/javascript/Interpreter.java M src/org/mozilla/javascript/InterpreterData.java A testsrc/org/mozilla/javascript/tests/ContinuationComparisonTest.java A testsrc/org/mozilla/javascript/tests/ContinuationComparisonTest.js Log Message: ----------- Use structural equality as the equality algorithm for Interpreter.CallFrame, which serves as the NativeContinuation implementation. Commit: d6dc98e5cfd25038d94d7642bc998abc478e6adb https://github.com/HtmlUnit/htmlunit-rhino-fork/commit/d6dc98e5cfd25038d94d7642bc998abc478e6adb Author: Attila Szegedi <sze...@gm...> Date: 2018-07-12 (Thu, 12 Jul 2018) Changed paths: M src/org/mozilla/javascript/EqualObjectGraphs.java Log Message: ----------- Add workarounds for #437 and #449 Commit: 211c5e64669799cbfc14afcde9fc5dde237e5d7a https://github.com/HtmlUnit/htmlunit-rhino-fork/commit/211c5e64669799cbfc14afcde9fc5dde237e5d7a Author: rbri <rb...@rb...> Date: 2018-07-21 (Sat, 21 Jul 2018) Changed paths: M src/org/mozilla/javascript/ArrowFunction.java M src/org/mozilla/javascript/BoundFunction.java A src/org/mozilla/javascript/EqualObjectGraphs.java M src/org/mozilla/javascript/IdFunctionObject.java M src/org/mozilla/javascript/Interpreter.java M src/org/mozilla/javascript/InterpreterData.java M src/org/mozilla/javascript/NativeContinuation.java M src/org/mozilla/javascript/NativeMath.java M src/org/mozilla/javascript/typedarrays/Conversions.java M src/org/mozilla/javascript/typedarrays/NativeTypedArrayView.java A testsrc/jstests/harmony/typed-array-ctor.js A testsrc/org/mozilla/javascript/EqualObjectGraphsTest.java A testsrc/org/mozilla/javascript/tests/ContinuationComparisonTest.java A testsrc/org/mozilla/javascript/tests/ContinuationComparisonTest.js A testsrc/org/mozilla/javascript/tests/harmony/TypedArrayCtorTest.java M testsrc/test262.properties Log Message: ----------- Merge remote-tracking branch 'upstream/master' # Conflicts: # src/org/mozilla/javascript/InterpreterData.java Compare: https://github.com/HtmlUnit/htmlunit-rhino-fork/compare/a03ef44c7097...211c5e646697 **NOTE:** This service been marked for deprecation: https://developer.github.com/changes/2018-04-25-github-services-deprecation/ Functionality will be removed from GitHub.com on January 31st, 2019. |
From: RBRi <rb...@us...> - 2018-07-19 19:15:55
|
Sorry, there was something else more important on my desk, but now i will have a look at your problem. --- ** [bugs:#1967] Clicking button has stopped working and returns same web page** **Status:** accepted **Group:** 2.31 **Created:** Mon Jun 11, 2018 09:45 AM UTC by Martin Strange **Last Updated:** Tue Jul 03, 2018 01:18 AM UTC **Owner:** RBRi Until recently, I have been running HtmlUnit 2.25. It was throwing up rhino errors but still allowed my code to click the edit button in a Google Sites web page to bring up the editable version of the page. My code has recently stopped working. Now when I call click() to click the edit button, the same web page is returned (easy to verify since the returned web page still contains the edit button and not the save button of the editable web page). I have switched to HmtlUnit 2.31. The good news is the rhino errors have gone. But click() is still not advancing to the editable web page. The problem doesn't seem likely to be a Javascript error, since once the right element is obtained I don't think Javascript is involved in the actual click() process. Here is my code: ~~~ :::java // Set up the web client. WebClient webClient = new WebClient(BrowserVersion.CHROME); // Read in cookies file so that the Google Sites server will recognise // me as logged in and return the logged in web page in the following // getPage call (code not shown here as this all works fine). // Get logged in web page. HtmlPage loggedInPage= webClient.getPage("https://sites.google.com/site/[my-web-page-at-google-sites]"); // Wait 2 secs just in case time is needed to execute Javascript. webClient.waitForBackgroundJavaScriptStartingBefore(2000); // Get the element (edit button) to click. HtmlElement element loggedInPage.getElementById("edit-start-btn"); // Check that element obtained is the correct edit button and all is // looking good for clicking it. System.out.println("Element about to be clicked is: + element); // Click the edit button to get the editable web page. HtmlPage editablePage = element.click(); // Have a look at the returned web page to see if it is the editable page. System.out.println(editablePage.asXml()); ~~~ Here is the web page code snippet containing the button I want to click: ~~~html <div role="button" id="edit-start-btn" class="goog-inline-block jfk-button jfk-button-standard jfk-button-disabled" aria-disabled="true"> <span id="sites-collaborator-bar-edit-page-icon" class="sites-camelot-icon"> </span> </div> ~~~ My code finds the element on the web page OK since the println that outputs details about the element about to be clicked corresponds correctly with the edit button shown in this web page code snippet above: ~~~ Element about to be clicked is: HtmlDivision[<div role="button" id="edit-start-btn" class="goog-inline-block jfk-button jfk-button-standard jfk-button-collapse-right collaborator-btn-collapse-right" aria-disabled="false" aria-label="Edit page" tabindex="0">] ~~~ Why does my code fail, and why should it have previously worked OK in HtmlUnit 2.25 and then suddenly stopped working? I notice that the time now taken to perform the click() is at most a second or apparently instantaneous. When the code was working, it took a second or two. Could this indicate that HtmlUnit is not even going to the Google Sites server, perhaps returning the cached version of the same page instead? One thought I had but probably not relevant: could it be a focus issue? I know HtmlUnit has changed for text input in forms, now requiring the focus to be shifted to the form which wasn't the case before. Does the focus have to be shifted to a button before clicking it will work? Many thanks if you can help. I find HtmlUnit really useful in the work I do. It's an awesome tool and you guys do a fantastic job in developing and supporting it. --- Sent from sourceforge.net because htm...@li... is subscribed to https://sourceforge.net/p/htmlunit/bugs/ To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/htmlunit/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list. |
From: RBRi <rb...@us...> - 2018-07-19 19:14:34
|
- **status**: pending --> closed --- ** [bugs:#1971] Scraping ASPX pages with HtmlUnit** **Status:** closed **Group:** 2.31 **Labels:** web scraping micrsoft asp.net aspx **Created:** Fri Jun 29, 2018 08:27 PM UTC by Trevor Maliborski **Last Updated:** Thu Jul 19, 2018 07:14 PM UTC **Owner:** RBRi I'm currently trying to set up a web scraping tool for sites that present information from medical license databases. Many of the sites I've found and wish to use are .aspx sites. I haven't found much online that discusses scraping .aspx sites with HtmlUnit, and the information I have found has not been helpful. The issue I'm having is similar to that which occurs on sites with AJAX: dynamic results are attached to the DOM when they arrive, but the DOM that HtmlUnit pulls from the headless browser only contains the static elements. I've tried pausing the scraper's main thread, tried using `waitForBackgroundJavascript()`, and using more explicit waiting techniques, e.g. something like this, which is copied from the HtmlUnit site: ~~~ for (int i = 0; i < 20; i++) { if (condition_to_happen_after_js_execution) { break; } synchronized (page) { page.wait(500); } } ~~~ Here's the code I have right now for scraping one of the sites: ~~~ private static String scrapeTexasDatabase(String firstName, String lastName) { try { WebClient webClient = new WebClient(BrowserVersion.CHROME); HtmlPage homePage = webClient.getPage("https://www.bon.texas.gov/forms/apninq.asp"); HtmlTextInput firstNameField = homePage.getForms().get(1).getInputByName("firstname"); HtmlTextInput lastNameField = homePage.getForms().get(1).getInputByName("lastname"); firstNameField.setValueAttribute(firstName); lastNameField.setValueAttribute(lastName); HtmlSubmitInput searchButton = homePage.getForms().get(1).getInputByValue("Submit"); HtmlPage resultsPage = searchButton.click(); // this should be the inner text of a heading tag which includes the name of someone // from the Texas database, but instead no h2 elements are found at all String str = resultsPage.getElementsByTagName("h2").get(0).getTextContent(); return str.trim(); } catch (Exception e) { System.out.println("Caught exception: " + e); } return null; } ~~~ Searching for "Joesph Smith" on the Texas Nursing License site being used here yields a single result. After looking through the page source, I've found that an <h2> element is placed at the top of each result, a heading which holds a given license holder's name. This information is added dynamically but I still need to be able to scrape the information for each search result. Any help would be appreciated! --- Sent from sourceforge.net because htm...@li... is subscribed to https://sourceforge.net/p/htmlunit/bugs/ To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/htmlunit/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list. |
From: RBRi <rb...@us...> - 2018-07-19 19:14:14
|
No feedback from the reporter, will close this now. Please reopen or create a new one if you still have problems. --- ** [bugs:#1971] Scraping ASPX pages with HtmlUnit** **Status:** pending **Group:** 2.31 **Labels:** web scraping micrsoft asp.net aspx **Created:** Fri Jun 29, 2018 08:27 PM UTC by Trevor Maliborski **Last Updated:** Tue Jul 10, 2018 01:41 PM UTC **Owner:** RBRi I'm currently trying to set up a web scraping tool for sites that present information from medical license databases. Many of the sites I've found and wish to use are .aspx sites. I haven't found much online that discusses scraping .aspx sites with HtmlUnit, and the information I have found has not been helpful. The issue I'm having is similar to that which occurs on sites with AJAX: dynamic results are attached to the DOM when they arrive, but the DOM that HtmlUnit pulls from the headless browser only contains the static elements. I've tried pausing the scraper's main thread, tried using `waitForBackgroundJavascript()`, and using more explicit waiting techniques, e.g. something like this, which is copied from the HtmlUnit site: ~~~ for (int i = 0; i < 20; i++) { if (condition_to_happen_after_js_execution) { break; } synchronized (page) { page.wait(500); } } ~~~ Here's the code I have right now for scraping one of the sites: ~~~ private static String scrapeTexasDatabase(String firstName, String lastName) { try { WebClient webClient = new WebClient(BrowserVersion.CHROME); HtmlPage homePage = webClient.getPage("https://www.bon.texas.gov/forms/apninq.asp"); HtmlTextInput firstNameField = homePage.getForms().get(1).getInputByName("firstname"); HtmlTextInput lastNameField = homePage.getForms().get(1).getInputByName("lastname"); firstNameField.setValueAttribute(firstName); lastNameField.setValueAttribute(lastName); HtmlSubmitInput searchButton = homePage.getForms().get(1).getInputByValue("Submit"); HtmlPage resultsPage = searchButton.click(); // this should be the inner text of a heading tag which includes the name of someone // from the Texas database, but instead no h2 elements are found at all String str = resultsPage.getElementsByTagName("h2").get(0).getTextContent(); return str.trim(); } catch (Exception e) { System.out.println("Caught exception: " + e); } return null; } ~~~ Searching for "Joesph Smith" on the Texas Nursing License site being used here yields a single result. After looking through the page source, I've found that an <h2> element is placed at the top of each result, a heading which holds a given license holder's name. This information is added dynamically but I still need to be able to scrape the information for each search result. Any help would be appreciated! --- Sent from sourceforge.net because htm...@li... is subscribed to https://sourceforge.net/p/htmlunit/bugs/ To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/htmlunit/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list. |
From: RBRi <rb...@us...> - 2018-07-19 19:12:53
|
- **status**: accepted --> pending --- ** [bugs:#1973] URLs are not properly encoded as UTF-8** **Status:** pending **Group:** 2.31 **Created:** Thu Jul 12, 2018 01:42 AM UTC by Thrawn **Last Updated:** Thu Jul 19, 2018 07:12 PM UTC **Owner:** RBRi HTMLUnit is not properly encoding UTF-8 request URLs. This causes failures when servers strictly validate those URLs. Minimal test case: - A Spring controller that calls HttpServletRequest.getParameterMap(), such as: @RequestMapping(value = "/", method = {RequestMethod.GET, RequestMethod.HEAD}) public String welcome(HttpServletRequest request) { request.getParameterMap(); return "index"; } - Run on Jetty 9.4.x (9.4.9.v20180320 and 9.4.11.v20180605 are confirmed), eg using the Jetty Maven plugin - Run a unit test that creates a Selenium HTMLUnitDriver and attempts to load /?param=Publisher`s\u2013\u00a0Internationalé\u2014Pty\u00a9Ltd Expected: The page loads and ignores the parameter Actual: A server error occurs, reporting: org.eclipse.jetty.util.Utf8Appendable$NotUtf8Exception: Not valid UTF8! byte A0 in state 0 at org.eclipse.jetty.util.Utf8Appendable.appendByte (Utf8Appendable.java:253) at org.eclipse.jetty.util.Utf8Appendable.append (Utf8Appendable.java:158) at org.eclipse.jetty.util.UrlEncoded.decodeUtf8To (UrlEncoded.java:354) at org.eclipse.jetty.util.UrlEncoded.decodeUtf8To (UrlEncoded.java:296) at org.eclipse.jetty.http.HttpURI.decodeQueryTo (HttpURI.java:615) at org.eclipse.jetty.server.Request.extractQueryParameters (Request.java:437) at org.eclipse.jetty.server.Request.getParameters (Request.java:401) at org.eclipse.jetty.server.Request.getParameterMap (Request.java:1035) --- Sent from sourceforge.net because htm...@li... is subscribed to https://sourceforge.net/p/htmlunit/bugs/ To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/htmlunit/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list. |
From: RBRi <rb...@us...> - 2018-07-19 19:12:41
|
Thanks for the report, hopefully i have addressed the issue in the right way, was not that simple and many of our test expectations where outdated. Please try the latest snapshot build and report if it now works for you. Thanks for using HtmlUnit --- ** [bugs:#1973] URLs are not properly encoded as UTF-8** **Status:** accepted **Group:** 2.31 **Created:** Thu Jul 12, 2018 01:42 AM UTC by Thrawn **Last Updated:** Thu Jul 12, 2018 05:45 PM UTC **Owner:** RBRi HTMLUnit is not properly encoding UTF-8 request URLs. This causes failures when servers strictly validate those URLs. Minimal test case: - A Spring controller that calls HttpServletRequest.getParameterMap(), such as: @RequestMapping(value = "/", method = {RequestMethod.GET, RequestMethod.HEAD}) public String welcome(HttpServletRequest request) { request.getParameterMap(); return "index"; } - Run on Jetty 9.4.x (9.4.9.v20180320 and 9.4.11.v20180605 are confirmed), eg using the Jetty Maven plugin - Run a unit test that creates a Selenium HTMLUnitDriver and attempts to load /?param=Publisher`s\u2013\u00a0Internationalé\u2014Pty\u00a9Ltd Expected: The page loads and ignores the parameter Actual: A server error occurs, reporting: org.eclipse.jetty.util.Utf8Appendable$NotUtf8Exception: Not valid UTF8! byte A0 in state 0 at org.eclipse.jetty.util.Utf8Appendable.appendByte (Utf8Appendable.java:253) at org.eclipse.jetty.util.Utf8Appendable.append (Utf8Appendable.java:158) at org.eclipse.jetty.util.UrlEncoded.decodeUtf8To (UrlEncoded.java:354) at org.eclipse.jetty.util.UrlEncoded.decodeUtf8To (UrlEncoded.java:296) at org.eclipse.jetty.http.HttpURI.decodeQueryTo (HttpURI.java:615) at org.eclipse.jetty.server.Request.extractQueryParameters (Request.java:437) at org.eclipse.jetty.server.Request.getParameters (Request.java:401) at org.eclipse.jetty.server.Request.getParameterMap (Request.java:1035) --- Sent from sourceforge.net because htm...@li... is subscribed to https://sourceforge.net/p/htmlunit/bugs/ To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/htmlunit/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list. |