You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(6) |
Jul
(17) |
Aug
(18) |
Sep
(22) |
Oct
(16) |
Nov
(6) |
Dec
(11) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(11) |
Feb
(10) |
Mar
(34) |
Apr
(26) |
May
(6) |
Jun
(22) |
Jul
(14) |
Aug
(4) |
Sep
(47) |
Oct
(69) |
Nov
(23) |
Dec
(21) |
2005 |
Jan
(53) |
Feb
(33) |
Mar
(92) |
Apr
(65) |
May
(63) |
Jun
(57) |
Jul
(43) |
Aug
(132) |
Sep
(61) |
Oct
(75) |
Nov
(60) |
Dec
(130) |
2006 |
Jan
(74) |
Feb
(87) |
Mar
(101) |
Apr
(58) |
May
(54) |
Jun
(42) |
Jul
(31) |
Aug
(67) |
Sep
(61) |
Oct
(71) |
Nov
(28) |
Dec
(58) |
2007 |
Jan
(53) |
Feb
(50) |
Mar
(96) |
Apr
(66) |
May
(55) |
Jun
(130) |
Jul
(99) |
Aug
(115) |
Sep
(37) |
Oct
(78) |
Nov
(24) |
Dec
(70) |
2008 |
Jan
(94) |
Feb
(85) |
Mar
(197) |
Apr
(274) |
May
(119) |
Jun
(143) |
Jul
(193) |
Aug
(99) |
Sep
(160) |
Oct
(120) |
Nov
(178) |
Dec
(109) |
2009 |
Jan
(238) |
Feb
(169) |
Mar
(115) |
Apr
(109) |
May
(131) |
Jun
(167) |
Jul
(144) |
Aug
(193) |
Sep
(155) |
Oct
(154) |
Nov
(97) |
Dec
(127) |
2010 |
Jan
(108) |
Feb
(127) |
Mar
(176) |
Apr
(113) |
May
(130) |
Jun
(200) |
Jul
(115) |
Aug
(80) |
Sep
(92) |
Oct
(101) |
Nov
(124) |
Dec
(53) |
2011 |
Jan
(67) |
Feb
(144) |
Mar
(88) |
Apr
(60) |
May
(89) |
Jun
(54) |
Jul
(68) |
Aug
(81) |
Sep
(48) |
Oct
(40) |
Nov
(10) |
Dec
(20) |
2012 |
Jan
(21) |
Feb
(28) |
Mar
(17) |
Apr
(35) |
May
(41) |
Jun
(44) |
Jul
(68) |
Aug
(67) |
Sep
(89) |
Oct
(58) |
Nov
(47) |
Dec
(56) |
2013 |
Jan
(49) |
Feb
(28) |
Mar
(46) |
Apr
(31) |
May
(28) |
Jun
(37) |
Jul
(34) |
Aug
(52) |
Sep
(42) |
Oct
(108) |
Nov
(59) |
Dec
(56) |
2014 |
Jan
(41) |
Feb
(72) |
Mar
(46) |
Apr
(21) |
May
(19) |
Jun
(17) |
Jul
(15) |
Aug
(40) |
Sep
(11) |
Oct
(3) |
Nov
(5) |
Dec
(31) |
2015 |
Jan
(11) |
Feb
(12) |
Mar
(19) |
Apr
(19) |
May
(38) |
Jun
(54) |
Jul
(14) |
Aug
(42) |
Sep
(14) |
Oct
(16) |
Nov
(26) |
Dec
(14) |
2016 |
Jan
(3) |
Feb
(1) |
Mar
(24) |
Apr
(5) |
May
(15) |
Jun
(14) |
Jul
(33) |
Aug
(19) |
Sep
(8) |
Oct
(10) |
Nov
|
Dec
(2) |
2017 |
Jan
(16) |
Feb
(12) |
Mar
(23) |
Apr
(8) |
May
(11) |
Jun
(20) |
Jul
(21) |
Aug
(20) |
Sep
|
Oct
(6) |
Nov
(9) |
Dec
(2) |
2018 |
Jan
(7) |
Feb
(5) |
Mar
(6) |
Apr
(5) |
May
(1) |
Jun
(2) |
Jul
(2) |
Aug
|
Sep
(4) |
Oct
(3) |
Nov
|
Dec
(4) |
2019 |
Jan
(2) |
Feb
(2) |
Mar
(3) |
Apr
(4) |
May
|
Jun
(4) |
Jul
(9) |
Aug
(2) |
Sep
|
Oct
(4) |
Nov
(1) |
Dec
(7) |
2020 |
Jan
(2) |
Feb
(6) |
Mar
(9) |
Apr
(1) |
May
(1) |
Jun
(15) |
Jul
(1) |
Aug
(1) |
Sep
(2) |
Oct
(6) |
Nov
(3) |
Dec
(5) |
2021 |
Jan
(3) |
Feb
(1) |
Mar
(2) |
Apr
(1) |
May
|
Jun
(1) |
Jul
(1) |
Aug
(3) |
Sep
(1) |
Oct
|
Nov
(1) |
Dec
|
2022 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
(1) |
Jul
(4) |
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(6) |
2025 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Rural H. <rur...@gm...> - 2017-06-26 09:15:26
|
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> </head> <body text="#000000" bgcolor="#FFFFFF"> <div class="moz-cite-prefix">Hi Guillaume,<br> <br> You'd better wait for some time after the click by WebClient.waitXXXXXX, especially for those scripts with ajax calls.<br> <br> 在 2017/6/26 16:59, Guillaume Lepinay 写道:<br> </div> <blockquote type="cite" cite="mid:CAJLCd59WswgcQ27kn1Zd51vZ4ZCELp+Q42K0m04_RANqLh=Yd...@ma..."> <div dir="ltr"> <div class="gmail_default" style="font-family:tahoma,sans-serif"><font color="#444444">Hello every body,</font></div> <div class="gmail_default" style="font-family:tahoma,sans-serif"><font color="#444444"><br> </font></div> <div class="gmail_default" style="font-family:tahoma,sans-serif"><font color="#444444">I have a link like this : </font></div> <div class="gmail_default" style="font-family:tahoma,sans-serif;color:rgb(51,51,255)"><br> </div> <div class="gmail_default"> <div class="gmail_default"><font face="monospace, monospace" color="#000000"><b><a tabindex="2" href=<a class="moz-txt-link-rfc2396E" href="javascript:raf()">"javascript:raf()"</a>></b></font></div> <div class="gmail_default"><font face="monospace, monospace" color="#000000"><b>&nbsp;&nbsp;0&nbsp;&nbsp;</b></font></div> <div class="gmail_default"><font face="monospace, monospace" color="#000000"><b></a></b></font></div> <div class="gmail_default" style="color:rgb(51,51,255);font-family:tahoma,sans-serif"><br> </div> <div class="gmail_default" style="font-family:tahoma,sans-serif"><font color="#444444">I can find it with HtmlUnit and I use the click() method to execute the javascript (method raf() in this example).</font></div> <div class="gmail_default" style="font-family:tahoma,sans-serif"><font color="#444444">But nothing happens.</font></div> <div class="gmail_default" style="color:rgb(51,51,255);font-family:tahoma,sans-serif"><br> </div> <div class="gmail_default" style="color:rgb(51,51,255);font-family:tahoma,sans-serif"><span style="color:rgb(68,68,68)">The script doesn't run any ajax request. It only changes the value of another field.</span><br> </div> <div class="gmail_default" style="color:rgb(51,51,255);font-family:tahoma,sans-serif"><span style="color:rgb(68,68,68)">But after clicking, when I get the value of the input that should have changed, it is still the same.</span></div> <div class="gmail_default" style="color:rgb(51,51,255);font-family:tahoma,sans-serif"><span style="color:rgb(68,68,68)"><br> </span></div> <div class="gmail_default" style="color:rgb(51,51,255);font-family:tahoma,sans-serif"><span style="color:rgb(68,68,68)">Is there something special to click this kind of link ?</span></div> <div class="gmail_default" style="color:rgb(51,51,255);font-family:tahoma,sans-serif"><span style="color:rgb(68,68,68)"><br> </span></div> <div class="gmail_default" style="color:rgb(51,51,255);font-family:tahoma,sans-serif"><span style="color:rgb(68,68,68)">Thank you for your help.</span></div> <div class="gmail_default" style="color:rgb(51,51,255);font-family:tahoma,sans-serif"><span style="color:rgb(68,68,68)"><br> </span></div> <div class="gmail_default" style="color:rgb(51,51,255);font-family:tahoma,sans-serif"><span style="color:rgb(68,68,68)">i'm using HtmlUnit 2.23. With the 2.27 and 2.28 SNAPSHOT I get an error due to illegal character inside the javascript pages.</span></div> </div> </div> <br> <fieldset class="mimeAttachmentHeader"></fieldset> <br> <pre wrap="">------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! <a class="moz-txt-link-freetext" href="http://sdm.link/slashdot">http://sdm.link/slashdot</a></pre> <br> <fieldset class="mimeAttachmentHeader"></fieldset> <br> <pre wrap="">_______________________________________________ Htmlunit-user mailing list <a class="moz-txt-link-abbreviated" href="mailto:Htm...@li...">Htm...@li...</a> <a class="moz-txt-link-freetext" href="https://lists.sourceforge.net/lists/listinfo/htmlunit-user">https://lists.sourceforge.net/lists/listinfo/htmlunit-user</a> </pre> </blockquote> <p><br> </p> </body> </html> |
From: Guillaume L. <gu...@gm...> - 2017-06-26 08:59:30
|
Hello every body, I have a link like this : *<a tabindex="2" href="javascript:raf()">* * 0 * *</a>* I can find it with HtmlUnit and I use the click() method to execute the javascript (method raf() in this example). But nothing happens. The script doesn't run any ajax request. It only changes the value of another field. But after clicking, when I get the value of the input that should have changed, it is still the same. Is there something special to click this kind of link ? Thank you for your help. i'm using HtmlUnit 2.23. With the 2.27 and 2.28 SNAPSHOT I get an error due to illegal character inside the javascript pages. |
From: minersail <jkw...@gm...> - 2017-06-25 22:44:10
|
I have tried to do the typical log in with HTMLUnit by filling in inputs and clicking the submit button. However, that didn't work, even with giving the webpage 20 seconds to load. So instead, I've tried to log in using a POST WebRequest, which has worked. The cookies successfully updated and the site itself in chrome told me that I was logged in elsewhere. The page returned by the POST was not a valid html page though, so I could not navigate directly from there. When I now use the webclient to navigate through the website, it does not register me as logged in. I've tried both navigating to the website regularly with client.getPage() as well as a GET request with the updated cookies attached. How would I get the logged in state from the POST request to transfer over when navigating through the rest of the website? I have omitted code for brevity but can post any relevant code necessary. -- View this message in context: http://htmlunit.10904.n7.nabble.com/Navigate-website-after-logging-in-using-WebRequest-tp42263.html Sent from the HtmlUnit - General mailing list archive at Nabble.com. |
From: Guillaume L. <gu...@gm...> - 2017-06-21 10:44:59
|
Hello, thank you for your fast reply. I just checked the bug tracker and I found this similar issue : https://sourceforge.net/p/htmlunit/bugs/1895/ There is a comment that says it was working with version 2.23. So I tested my situation with version 2.23, and that's true, with version 2.23 it is working, but not with 2.27. Le mer. 21 juin 2017 à 11:32, Ronald Brill <rb...@rb...> a écrit : > Thanks for the info, will have a look. > Can you please open an issue.... > > Thanks > RBRi > > On Wed, 21 Jun 2017 01:51:46 -0700 Guillaume Lepinay wrote: > > > >Hello every one > > > >I'm trying to use HtmlUnit to connect a webpage, but a javascript has some > >accent characters (like é or ? or ?) and it throws an exception. > > > >The code to reproduce the issue is very simple : > > > >* String urlDepart = "https://www.ca-languedoc.fr/ > ><https://www.ca-languedoc.fr/>";* > >* try (WebClient webClient = new WebClient(BrowserVersion.CHROME)) > {* > > > > > >* HtmlPage page = webClient.getPage(urlDepart);* > >* String title = page.getTitleText();* > > > >* System.out.println("Title : "+title);* > > > >* }* > > > >The page is : https://www.ca-languedoc.fr/Vitrine/ObjCommun/js/xiti.js > >I tried to add the "-Dfile.encoding=UTF-8" but it didn't solve the > problem. > > > >Do you have any idea about it ? > > > >I'm using HTML Unit 2.27, from maven : > > > > <dependency> > > <groupId>net.sourceforge.htmlunit</groupId> > > <artifactId>htmlunit</artifactId> > > <version>2.27</version> > > </dependency> > > > >Thank you for your help :) > >Guillaume > > > > > > > >----< Inline text [text-plain-04.txt] >------------------ > > > >----------------------------------------------------------------------- > ------- > >Check out the vibrant tech community on one of the world's most > >engaging tech sites, Slashdot.org! http://sdm.link/slashdot > > > > > >----< Inline text [text-plain-05.txt] >------------------ > > > >_______________________________________________ > >Htmlunit-user mailing list > >Htm...@li... > >https://lists.sourceforge.net/lists/listinfo/htmlunit-user > > > > > > -- Cordialement, Guillaume Lepinay www.clangen.com 09 52 95 97 99 |
From: Ronald B. <rb...@rb...> - 2017-06-21 09:32:54
|
Thanks for the info, will have a look. Can you please open an issue.... Thanks RBRi On Wed, 21 Jun 2017 01:51:46 -0700 Guillaume Lepinay wrote: > >Hello every one > >I'm trying to use HtmlUnit to connect a webpage, but a javascript has some >accent characters (like é or ? or ?) and it throws an exception. > >The code to reproduce the issue is very simple : > >* String urlDepart = "https://www.ca-languedoc.fr/ ><https://www.ca-languedoc.fr/>";* >* try (WebClient webClient = new WebClient(BrowserVersion.CHROME)) {* > > >* HtmlPage page = webClient.getPage(urlDepart);* >* String title = page.getTitleText();* > >* System.out.println("Title : "+title);* > >* }* > >The page is : https://www.ca-languedoc.fr/Vitrine/ObjCommun/js/xiti.js >I tried to add the "-Dfile.encoding=UTF-8" but it didn't solve the problem. > >Do you have any idea about it ? > >I'm using HTML Unit 2.27, from maven : > > <dependency> > <groupId>net.sourceforge.htmlunit</groupId> > <artifactId>htmlunit</artifactId> > <version>2.27</version> > </dependency> > >Thank you for your help :) >Guillaume > > > >----< Inline text [text-plain-04.txt] >------------------ > >----------------------------------------------------------------------- ------- >Check out the vibrant tech community on one of the world's most >engaging tech sites, Slashdot.org! http://sdm.link/slashdot > > >----< Inline text [text-plain-05.txt] >------------------ > >_______________________________________________ >Htmlunit-user mailing list >Htm...@li... >https://lists.sourceforge.net/lists/listinfo/htmlunit-user > > |
From: Guillaume L. <gu...@gm...> - 2017-06-21 08:52:15
|
Hello every one I'm trying to use HtmlUnit to connect a webpage, but a javascript has some accent characters (like é or è or à) and it throws an exception. The code to reproduce the issue is very simple : * String urlDepart = "https://www.ca-languedoc.fr/ <https://www.ca-languedoc.fr/>";* * try (WebClient webClient = new WebClient(BrowserVersion.CHROME)) {* * HtmlPage page = webClient.getPage(urlDepart);* * String title = page.getTitleText();* * System.out.println("Title : "+title);* * }* The page is : https://www.ca-languedoc.fr/Vitrine/ObjCommun/js/xiti.js I tried to add the "-Dfile.encoding=UTF-8" but it didn't solve the problem. Do you have any idea about it ? I'm using HTML Unit 2.27, from maven : <dependency> <groupId>net.sourceforge.htmlunit</groupId> <artifactId>htmlunit</artifactId> <version>2.27</version> </dependency> Thank you for your help :) Guillaume |
From: Joerg W. <wer...@gm...> - 2017-06-20 12:18:58
|
Looks like a clean solution! Our only use case is modifying the user agent string. We do so by simply cloning one of the predefined browser versions and setting the new user agent. We never had the need to change the internal browser setup in any way. So all we need is covered. Having to adjust our code a little is not an issue for us. Best, J. On 6/16/2017 21:15, Ronald Brill wrote: > Hi HtmlUnit users, hi HtmlUnit developers, > > it looks like we have currently a major design flaw with the way HtmlUnit handles different browser versions. > > The problem is in short: > * the final browser setup is done by different technics; getter/setter in class BrowserVersion, Jsx annotations and constants in BrowserVersionFeatures > * the user is able to define (clone) browser versions but in the end only limited parts of the setup is realy changeable; this has lead to some wrong expectations and > misunderstanding in the past > * the browser version is used inside the code without taking care of this cloned versions and this might be the root of some errors we got > * it is possible to change parts of the BrowserVersion at a later point, the code is not aware of this and does strange things > > Because i think we are not able to fix this in a backward compatible manner i like to discuss possible solutions here. > > Suggestions: > * it will still be possible for the user to create browser versions based on the existing ones > * the user can only configure the part of the browser setup that is configurable at the moment by using the setters in BrowserVersion > * to avoid problems and later changes of the BrowserVersion we will support this by using a builder pattern similar to this > > BrowserVersionBuilder builder = new BrowserVersionBuilder(BrowserVersion.CROME); > builder.setPlatform("BeOS"); > .... > BrowserVersion myBeBrowser = builder.build(); > > new WebClient(myBeBrowser); > > ** if there is an BrowserVersion with exact the same setup as your Builder is asking for, this will return the already existing BrowserVersion > ** using the BrowserVersionBuilder you will have similar options as you have today for the BrowserVersion > ** it is no longer possible to change the BrowserVersion itself because the setters are longer available > > This will have some imlications for you current code: > > * HtmlUnit will internally maintain a list of browsers - mabe you can get a browser from this list by name > * BrowserVersion will be fixed if you finished with the setup, it will not be possible to change the configuration later on (this is possible today but will definitly introduce trouble > for you) > * you have to adapt your code > * It seems to be possible to introduce this change the usual way by making the existing API deprecated and remove with later versions > > What do you think. > Is this ok for our brave users? Do you need support for more? > Any better ideas/suggestions/improvements? > > > RBRi > -------------------------- > WETATOR > Smart web application testing > http://www.wetator.org > > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user |
From: Rural H. <rur...@gm...> - 2017-06-20 07:34:53
|
Hi, Does htmlunit support the CSS pseudo elements ::before and ::after? If yes, how to get it on the html element? |
From: Rural H. <rur...@gm...> - 2017-06-20 07:14:04
|
Seems fine to me. We use customized new BrowserVersions instead of setters to change the default BrowserVersions if we want to change some browser properties. 在 2017/6/17 3:15, Ronald Brill 写道: > Hi HtmlUnit users, hi HtmlUnit developers, > > it looks like we have currently a major design flaw with the way HtmlUnit handles different browser versions. > > The problem is in short: > * the final browser setup is done by different technics; getter/setter in class BrowserVersion, Jsx annotations and constants in BrowserVersionFeatures > * the user is able to define (clone) browser versions but in the end only limited parts of the setup is realy changeable; this has lead to some wrong expectations and > misunderstanding in the past > * the browser version is used inside the code without taking care of this cloned versions and this might be the root of some errors we got > * it is possible to change parts of the BrowserVersion at a later point, the code is not aware of this and does strange things > > Because i think we are not able to fix this in a backward compatible manner i like to discuss possible solutions here. > > Suggestions: > * it will still be possible for the user to create browser versions based on the existing ones > * the user can only configure the part of the browser setup that is configurable at the moment by using the setters in BrowserVersion > * to avoid problems and later changes of the BrowserVersion we will support this by using a builder pattern similar to this > > BrowserVersionBuilder builder = new BrowserVersionBuilder(BrowserVersion.CROME); > builder.setPlatform("BeOS"); > .... > BrowserVersion myBeBrowser = builder.build(); > > new WebClient(myBeBrowser); > > ** if there is an BrowserVersion with exact the same setup as your Builder is asking for, this will return the already existing BrowserVersion > ** using the BrowserVersionBuilder you will have similar options as you have today for the BrowserVersion > ** it is no longer possible to change the BrowserVersion itself because the setters are longer available > > This will have some imlications for you current code: > > * HtmlUnit will internally maintain a list of browsers - mabe you can get a browser from this list by name > * BrowserVersion will be fixed if you finished with the setup, it will not be possible to change the configuration later on (this is possible today but will definitly introduce trouble > for you) > * you have to adapt your code > * It seems to be possible to introduce this change the usual way by making the existing API deprecated and remove with later versions > > What do you think. > Is this ok for our brave users? Do you need support for more? > Any better ideas/suggestions/improvements? > > > RBRi > -------------------------- > WETATOR > Smart web application testing > http://www.wetator.org > > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > |
From: Ronald B. <rb...@rb...> - 2017-06-16 19:15:45
|
Hi HtmlUnit users, hi HtmlUnit developers, it looks like we have currently a major design flaw with the way HtmlUnit handles different browser versions. The problem is in short: * the final browser setup is done by different technics; getter/setter in class BrowserVersion, Jsx annotations and constants in BrowserVersionFeatures * the user is able to define (clone) browser versions but in the end only limited parts of the setup is realy changeable; this has lead to some wrong expectations and misunderstanding in the past * the browser version is used inside the code without taking care of this cloned versions and this might be the root of some errors we got * it is possible to change parts of the BrowserVersion at a later point, the code is not aware of this and does strange things Because i think we are not able to fix this in a backward compatible manner i like to discuss possible solutions here. Suggestions: * it will still be possible for the user to create browser versions based on the existing ones * the user can only configure the part of the browser setup that is configurable at the moment by using the setters in BrowserVersion * to avoid problems and later changes of the BrowserVersion we will support this by using a builder pattern similar to this BrowserVersionBuilder builder = new BrowserVersionBuilder(BrowserVersion.CROME); builder.setPlatform("BeOS"); .... BrowserVersion myBeBrowser = builder.build(); new WebClient(myBeBrowser); ** if there is an BrowserVersion with exact the same setup as your Builder is asking for, this will return the already existing BrowserVersion ** using the BrowserVersionBuilder you will have similar options as you have today for the BrowserVersion ** it is no longer possible to change the BrowserVersion itself because the setters are longer available This will have some imlications for you current code: * HtmlUnit will internally maintain a list of browsers - mabe you can get a browser from this list by name * BrowserVersion will be fixed if you finished with the setup, it will not be possible to change the configuration later on (this is possible today but will definitly introduce trouble for you) * you have to adapt your code * It seems to be possible to introduce this change the usual way by making the existing API deprecated and remove with later versions What do you think. Is this ok for our brave users? Do you need support for more? Any better ideas/suggestions/improvements? RBRi -------------------------- WETATOR Smart web application testing http://www.wetator.org |
From: Ahmed A. <asa...@ya...> - 2017-06-04 10:04:02
|
Hi all, It is a pleasure to announce the availability of HtmlUnit 2.27. The main enhancements are: - Support Firefox 52 - Add BrowserVersion.setSystemTimezone() - Add HtmlImageInput.saveAs() - Remove HtmlKeygen - Various fixes, specially with JavaScript The full list of changes can be found in [1] Thanks to all the contributors. Happy Scraping!The HtmlUnit team [1] http://htmlunit.sourceforge.net/changes-report.html#a2.27 |
From: Ronald B. <rb...@rb...> - 2017-05-23 19:25:52
|
Hi Gyetvai >and thanks for any hint. >I am using HtmlUnit 2.5 HtmlUnit 2.5 is really outdated. Please use the latest version or even better the latest snapshot (details are available at the web page). Sorry but we can't support old versions. >I am trying to click on a link with the following Href attribute: > >javascript:window.open('https://www.apps.amway.hu/shop/los/los.aspx?lng=hu', >'points_window', >'width=830,height=580,location=0,menubar=0,resizable=1,scrollbars=1,status=1 >,titlebar=0,toolbar=0');void(0); The javascript here is not the problem. There seems to be some javascript in the new window executed after the window opens. This javascript fails. >It is a pop-up window. The WebWindowListener catches the window but then it >crashes. RBRi -------------------------- WETATOR Smart web application testing http://www.wetator.org |
From: Gyetvai B. <gyb...@gm...> - 2017-05-21 14:44:33
|
Htm...@li... <mailto:Htm...@li...> Hi, and thanks for any hint. I am using HtmlUnit 2.5 I am trying to click on a link with the following Href attribute: javascript:window.open('https://www.apps.amway.hu/shop/los/los.aspx?lng=hu', 'points_window', 'width=830,height=580,location=0,menubar=0,resizable=1,scrollbars=1,status=1 ,titlebar=0,toolbar=0');void(0); It is a pop-up window. The WebWindowListener catches the window but then it crashes. My code: link = (HtmlAnchor) page.getFirstByXPath("//*[@id=\"content\"]/div[2]/div[2]/div[3]/a"); page= (HtmlPage) link.click(); Stack: com.gargoylesoftware.htmlunit.ScriptException: Exception invoking open ======= EXCEPTION START ======== Exception class=[java.lang.RuntimeException] com.gargoylesoftware.htmlunit.ScriptException: Exception invoking open at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAct ion.run(JavaScriptEngine.java:894) at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:628) at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactor y.java:515) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScript Engine.java:775) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScript Engine.java:751) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScript Engine.java:739) at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptIfPossible(Html Page.java:910) at com.gargoylesoftware.htmlunit.html.HtmlAnchor.doClickStateUpdate(HtmlAnchor. java:133) at com.gargoylesoftware.htmlunit.html.HtmlAnchor.doClickStateUpdate(HtmlAnchor. java:211) at com.gargoylesoftware.htmlunit.html.DomElement.click(DomElement.java:999) at com.gargoylesoftware.htmlunit.html.HtmlAnchor.click(HtmlAnchor.java:83) at com.gargoylesoftware.htmlunit.html.DomElement.click(DomElement.java:944) at com.gargoylesoftware.htmlunit.html.DomElement.click(DomElement.java:884) at com.gargoylesoftware.htmlunit.html.DomElement.click(DomElement.java:865) at PopUpAmw.PopUpAmw.main(PopUpAmw.java:191) Caused by: java.lang.RuntimeException: Exception invoking open at net.sourceforge.htmlunit.corejs.javascript.MemberBox.invoke(MemberBox.java:1 82) at net.sourceforge.htmlunit.corejs.javascript.FunctionObject.call(FunctionObjec t.java:448) at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpretLoop(Interpr eter.java:1540) at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpret(Interpreter .java:800) at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call(Interpre tedFunction.java:105) at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.doTopCall(ContextF actory.java:413) at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.doTopCall(Ht mlUnitContextFactory.java:292) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.doTopCall(ScriptRun time.java:3264) at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.exec(Interpre tedFunction.java:115) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$3.doRun(JavaScript Engine.java:766) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAct ion.run(JavaScriptEngine.java:879) ... 14 more Caused by: com.gargoylesoftware.htmlunit.ScriptException: TypeError: Cannot read property "length" from undefined (https://www.apps.amway.hu/Shop/JS/Tealeaf/TeaLeaf.js#270) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAct ion.run(JavaScriptEngine.java:894) at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:628) at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactor y.java:515) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaS criptEngine.java:824) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaS criptEngine.java:796) at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptFunctionIfPossi ble(HtmlPage.java:2454) at com.gargoylesoftware.htmlunit.javascript.host.event.EventListenersContainer. executeEventListeners(EventListenersContainer.java:259) at com.gargoylesoftware.htmlunit.javascript.host.event.EventListenersContainer. executeBubblingListeners(EventListenersContainer.java:325) at com.gargoylesoftware.htmlunit.javascript.host.event.EventTarget.fireEvent(Ev entTarget.java:188) at com.gargoylesoftware.htmlunit.html.DomElement$2.run(DomElement.java:1389) at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:628) at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactor y.java:515) at com.gargoylesoftware.htmlunit.html.DomElement.fireEvent(DomElement.java:1394 ) at com.gargoylesoftware.htmlunit.html.HtmlPage.executeEventHandlersIfNeeded(Htm lPage.java:1201) at com.gargoylesoftware.htmlunit.html.HtmlPage.initialize(HtmlPage.java:253) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:5 24) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:391) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:309) at com.gargoylesoftware.htmlunit.WebClient.openWindow(WebClient.java:874) at com.gargoylesoftware.htmlunit.javascript.host.Window.open(Window.java:453) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62 ) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl .java:43) at java.lang.reflect.Method.invoke(Method.java:498) at net.sourceforge.htmlunit.corejs.javascript.MemberBox.invoke(MemberBox.java:1 53) ... 24 more Caused by: net.sourceforge.htmlunit.corejs.javascript.EcmaError: TypeError: Cannot read property "length" from undefined (https://www.apps.amway.hu/Shop/JS/Tealeaf/TeaLeaf.js#270) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(Scri ptRuntime.java:3915) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(Scri ptRuntime.java:3899) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.typeError(ScriptRun time.java:3924) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.typeError2(ScriptRu ntime.java:3940) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.undefReadError(Scri ptRuntime.java:3951) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.getObjectProp(Scrip tRuntime.java:1492) at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpretLoop(Interpr eter.java:1247) at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpret(Interpreter .java:800) at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call(Interpre tedFunction.java:105) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$4.doRun(JavaScript Engine.java:815) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAct ion.run(JavaScriptEngine.java:879) ... 48 more Enclosed exception: java.lang.RuntimeException: Exception invoking open at net.sourceforge.htmlunit.corejs.javascript.MemberBox.invoke(MemberBox.java:1 82) at net.sourceforge.htmlunit.corejs.javascript.FunctionObject.call(FunctionObjec t.java:448) at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpretLoop(Interpr eter.java:1540) at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpret(Interpreter .java:800) at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call(Interpre tedFunction.java:105) at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.doTopCall(ContextF actory.java:413) at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.doTopCall(Ht mlUnitContextFactory.java:292) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.doTopCall(ScriptRun time.java:3264) at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.exec(Interpre tedFunction.java:115) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$3.doRun(JavaScript Engine.java:766) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAct ion.run(JavaScriptEngine.java:879) at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:628) at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactor y.java:515) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScript Engine.java:775) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScript Engine.java:751) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScript Engine.java:739) at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptIfPossible(Html Page.java:910) at com.gargoylesoftware.htmlunit.html.HtmlAnchor.doClickStateUpdate(HtmlAnchor. java:133) at com.gargoylesoftware.htmlunit.html.HtmlAnchor.doClickStateUpdate(HtmlAnchor. java:211) at com.gargoylesoftware.htmlunit.html.DomElement.click(DomElement.java:999) at com.gargoylesoftware.htmlunit.html.HtmlAnchor.click(HtmlAnchor.java:83) at com.gargoylesoftware.htmlunit.html.DomElement.click(DomElement.java:944) at com.gargoylesoftware.htmlunit.html.DomElement.click(DomElement.java:884) at com.gargoylesoftware.htmlunit.html.DomElement.click(DomElement.java:865) at PopUpAmw.PopUpAmw.main(PopUpAmw.java:191) Caused by: com.gargoylesoftware.htmlunit.ScriptException: TypeError: Cannot read property "length" from undefined (https://www.apps.amway.hu/Shop/JS/Tealeaf/TeaLeaf.js#270) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAct ion.run(JavaScriptEngine.java:894) at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:628) at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactor y.java:515) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaS criptEngine.java:824) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaS criptEngine.java:796) at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptFunctionIfPossi ble(HtmlPage.java:2454) at com.gargoylesoftware.htmlunit.javascript.host.event.EventListenersContainer. executeEventListeners(EventListenersContainer.java:259) at com.gargoylesoftware.htmlunit.javascript.host.event.EventListenersContainer. executeBubblingListeners(EventListenersContainer.java:325) at com.gargoylesoftware.htmlunit.javascript.host.event.EventTarget.fireEvent(Ev entTarget.java:188) at com.gargoylesoftware.htmlunit.html.DomElement$2.run(DomElement.java:1389) at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:628) at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactor y.java:515) at com.gargoylesoftware.htmlunit.html.DomElement.fireEvent(DomElement.java:1394 ) at com.gargoylesoftware.htmlunit.html.HtmlPage.executeEventHandlersIfNeeded(Htm lPage.java:1201) at com.gargoylesoftware.htmlunit.html.HtmlPage.initialize(HtmlPage.java:253) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:5 24) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:391) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:309) at com.gargoylesoftware.htmlunit.WebClient.openWindow(WebClient.java:874) at com.gargoylesoftware.htmlunit.javascript.host.Window.open(Window.java:453) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62 ) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl .java:43) at java.lang.reflect.Method.invoke(Method.java:498) at net.sourceforge.htmlunit.corejs.javascript.MemberBox.invoke(MemberBox.java:1 53) ... 24 more Caused by: net.sourceforge.htmlunit.corejs.javascript.EcmaError: TypeError: Cannot read property "length" from undefined (https://www.apps.amway.hu/Shop/JS/Tealeaf/TeaLeaf.js#270) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(Scri ptRuntime.java:3915) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(Scri ptRuntime.java:3899) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.typeError(ScriptRun time.java:3924) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.typeError2(ScriptRu ntime.java:3940) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.undefReadError(Scri ptRuntime.java:3951) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.getObjectProp(Scrip tRuntime.java:1492) at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpretLoop(Interpr eter.java:1247) at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpret(Interpreter .java:800) at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call(Interpre tedFunction.java:105) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$4.doRun(JavaScript Engine.java:815) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAct ion.run(JavaScriptEngine.java:879) ... 48 more ======= EXCEPTION END ======== |
From: Ronald B. <rb...@rb...> - 2017-05-10 14:39:39
|
Update your HttpClient to 4.5.3. RBRi On Wed, 10 May 2017 11:33:51 +0000 Achim Mustroph wrote: > >Hello, > >I'm trying to open a site under test with Selenium headless by using HTMLUnitDriver. With FirefoxDriver and ChromeDriver the code works but with htmlunitdriver I'm getting the following error: > >org.openqa.selenium.WebDriverException: java.lang.IllegalArgumentException: Cannot locate declared field class org.apache.http.impl.client.HttpClientBuilder.dnsResolver >Build info: version: '2.53.0', revision: '35ae25b', time: '2016-03-15 16:57:40' >System info: host: 'deleted by me', ip: 'deleted by me', os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.8.0_66' >Driver info: driver.version: HtmlUnitDriver > at org.openqa.selenium.htmlunit.HtmlUnitDriver.get(HtmlUnitDriver.java:688) > at org.openqa.selenium.htmlunit.HtmlUnitDriver.lambda$8(HtmlUnitDriver.java:657) > at org.openqa.selenium.htmlunit.HtmlUnitDriver.lambda$0(HtmlUnitDriver.java:414) > at java.lang.Thread.run(Thread.java:745) >Caused by: java.lang.IllegalArgumentException: Cannot locate declared field class org.apache.http.impl.client.HttpClientBuilder.dnsResolver > at org.apache.commons.lang3.Validate.isTrue(Validate.java:158) > at org.apache.commons.lang3.reflect.FieldUtils.readDeclaredField(FieldUtils.java:511) > at com.gargoylesoftware.htmlunit.HttpWebConnection.getField(HttpWebConnection.java:1038) > at com.gargoylesoftware.htmlunit.HttpWebConnection.createConnectionManager(HttpWebConnection.java:961) > at com.gargoylesoftware.htmlunit.HttpWebConnection.getResponse(HttpWebConnection.java:166) > at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseFromWebConnection(WebClient.java:1357) > at com.gargoylesoftware.htmlunit.WebClient.loadWebResponse(WebClient..java:1274) > at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:382) > at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:304) > at org.openqa.selenium.htmlunit.HtmlUnitDriver.get(HtmlUnitDriver.java:670) > ... 3 more > >After looking for the line that causes this error I found this: method in HttpWebConnection: > >final DnsResolver dnsResolver = getField(builder, "dnsResolver"); > >Finally this method is called: > >@SuppressWarnings("unchecked") >private static <T> T getField(final Object target, final String fieldName) throws IllegalAccessException { >return (T) FieldUtils.readDeclaredField(target, fieldName, true); > } > >I think the reason for that error could be that the field dnsResolver is private. > >I'm using the following pom.xml. I already checked that all components use their newest version: > ><?xml version="1.0" encoding="UTF-8"?> ><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven..apache.org/xsd/maven-4.0.0.xsd<http://maven.apache.org/POM/4.0.0%20http:/maven.apache.org/xsd/maven-4.0.0.xsd>"> > <modelVersion>4.0.0</modelVersion> > > <groupId>com.example</groupId> > <artifactId>Project</artifactId> > <version>1.0</version> > <packaging>jar</packaging> > > <name>PMTestApproach</name> > <description>Name says everything</description> > > <parent> > <groupId>org.springframework.boot</groupId> > <artifactId>spring-boot-starter-parent</artifactId> > <version>1.4.3.RELEASE</version> > <relativePath /> <!-- lookup parent from repository --> > </parent> > > <properties> > <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> > <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> > <java.version>1.8</java.version> > </properties> > <repositories> > <repository> > <id>jcenter</id> > <name>bintray</name> > <url>http://jcenter.bintray.com</url<http://jcenter.bintray.com%3c/url>> > </repository> > </repositories> > <dependencies> > <dependency> > <groupId>org.springframework.boot</groupId> > <artifactId>spring-boot-starter</artifactId> > </dependency> > <dependency> > <groupId>org.springframework.boot</groupId> > <artifactId>spring-boot-starter-test</artifactId> > <scope>test</scope> > </dependency> > <dependency> > <groupId>org.eclipse.paho</groupId> > <artifactId>org.eclipse.paho.client.mqttv3</artifactId> > <version>1.0.2</version> > </dependency> > <dependency> > <groupId>org.seleniumhq.selenium</groupId> > <artifactId>selenium-java</artifactId> > <version>3.4.0</version> > </dependency> > <dependency> > <groupId>org.testng</groupId> > <artifactId>testng</artifactId> > <version>6.11</version> > </dependency> > <dependency> > <groupId>org.apache.httpcomponents</groupId> > <artifactId>httpclient</artifactId> > <version>4.5.2</version> > </dependency> > <dependency> > <groupId>org.seleniumhq.selenium</groupId> > <artifactId>htmlunit-driver</artifactId> > <version>2.26</version> > </dependency> > </dependencies> > <build> > <plugins> > <plugin> > <groupId>org.springframework.boot</groupId> > <artifactId>spring-boot-maven-plugin</artifactId> > </plugin> > </plugins> > </build> ></project> > >Would you please help me solving this problem? > >Thanks and best regards > >Achim M. > > > >----< Inline text [text-plain-04.txt] >------------------ > >------------------------------------------------------------------------------ >Check out the vibrant tech community on one of the world's most >engaging tech sites, Slashdot.org! http://sdm.link/slashdot > > >----< Inline text [text-plain-05.txt] >------------------ > >_______________________________________________ >Htmlunit-user mailing list >Htm...@li... >https://lists.sourceforge.net/lists/listinfo/htmlunit-user > > |
From: Achim M. <ach...@is...> - 2017-05-10 12:07:06
|
Hello, I'm trying to open a site under test with Selenium headless by using HTMLUnitDriver. With FirefoxDriver and ChromeDriver the code works but with htmlunitdriver I'm getting the following error: org.openqa.selenium.WebDriverException: java.lang.IllegalArgumentException: Cannot locate declared field class org.apache.http.impl.client.HttpClientBuilder.dnsResolver Build info: version: '2.53.0', revision: '35ae25b', time: '2016-03-15 16:57:40' System info: host: 'deleted by me', ip: 'deleted by me', os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.8.0_66' Driver info: driver.version: HtmlUnitDriver at org.openqa.selenium.htmlunit.HtmlUnitDriver.get(HtmlUnitDriver.java:688) at org.openqa.selenium.htmlunit.HtmlUnitDriver.lambda$8(HtmlUnitDriver.java:657) at org.openqa.selenium.htmlunit.HtmlUnitDriver.lambda$0(HtmlUnitDriver.java:414) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.IllegalArgumentException: Cannot locate declared field class org.apache.http.impl.client.HttpClientBuilder.dnsResolver at org.apache.commons.lang3.Validate.isTrue(Validate.java:158) at org.apache.commons.lang3.reflect.FieldUtils.readDeclaredField(FieldUtils.java:511) at com.gargoylesoftware.htmlunit.HttpWebConnection.getField(HttpWebConnection.java:1038) at com.gargoylesoftware.htmlunit.HttpWebConnection.createConnectionManager(HttpWebConnection.java:961) at com.gargoylesoftware.htmlunit.HttpWebConnection.getResponse(HttpWebConnection.java:166) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseFromWebConnection(WebClient.java:1357) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponse(WebClient.java:1274) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:382) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:304) at org.openqa.selenium.htmlunit.HtmlUnitDriver.get(HtmlUnitDriver.java:670) ... 3 more After looking for the line that causes this error I found this: method in HttpWebConnection: final DnsResolver dnsResolver = getField(builder, "dnsResolver"); Finally this method is called: @SuppressWarnings("unchecked") private static <T> T getField(final Object target, final String fieldName) throws IllegalAccessException { return (T) FieldUtils.readDeclaredField(target, fieldName, true); } I think the reason for that error could be that the field dnsResolver is private. I'm using the following pom.xml. I already checked that all components use their newest version: <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd<http://maven.apache.org/POM/4.0.0%20http:/maven.apache.org/xsd/maven-4.0.0.xsd>"> <modelVersion>4.0.0</modelVersion> <groupId>com.example</groupId> <artifactId>Project</artifactId> <version>1.0</version> <packaging>jar</packaging> <name>PMTestApproach</name> <description>Name says everything</description> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.4.3.RELEASE</version> <relativePath /> <!-- lookup parent from repository --> </parent> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <java.version>1.8</java.version> </properties> <repositories> <repository> <id>jcenter</id> <name>bintray</name> <url>http://jcenter.bintray.com</url<http://jcenter.bintray.com%3c/url>> </repository> </repositories> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.eclipse.paho</groupId> <artifactId>org.eclipse.paho.client.mqttv3</artifactId> <version>1.0.2</version> </dependency> <dependency> <groupId>org.seleniumhq.selenium</groupId> <artifactId>selenium-java</artifactId> <version>3.4.0</version> </dependency> <dependency> <groupId>org.testng</groupId> <artifactId>testng</artifactId> <version>6.11</version> </dependency> <dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpclient</artifactId> <version>4.5.2</version> </dependency> <dependency> <groupId>org.seleniumhq.selenium</groupId> <artifactId>htmlunit-driver</artifactId> <version>2.26</version> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins> </build> </project> Would you please help me solving this problem? Thanks and best regards Achim M. |
From: Ahmed A. <asa...@ya...> - 2017-05-03 06:51:15
|
Hi Vasu, The below is only the client-side. As the server-side may be sending a different encoding that it states. Please isolate a minimal case with the server-side component using Serlvet, as in https://sourceforge.net/p/htmlunit/code/HEAD/tree/trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/WebResponseTest.java#l233 Ahmed From: Vasudevan Comandur <vco...@gm...> To: Ahmed Ashour <asa...@ya...>; "htm...@li..." <htm...@li...> Sent: Tuesday, May 2, 2017 10:30 PM Subject: Re: [Htmlunit-user] Clarification Requried Hi Ahmed, I had changed the HTTP Header Accept-Encoding to deflate and HTMLUnit 2.23 was reading the content. However, if I had left it to the default Accept-Encoding to gzip, deflate header, it was not giving me the content. Let me know if you need any other stuff from me. Response HEader from Host when defalte was set | | HTTP/1.1 200 OK | | Server | AtyponWS/7.1 | | Last-Modified | Mon, 01 May 2017 22:55:39 GMT | | Expires | Thu, 19 Oct 2017 05:40:28 GMT | | Cache-Control | public | | Vary | User-Agent,Accept-Encoding | | Content-Type | text/css; charset=UTF-8 | | Date | Tue, 02 May 2017 20:23:20 GMT | | Content-Encoding | deflate | | Transfer-Encoding | chunked | Response Header from Host when gzip was set | | HTTP/1.1 200 OK | | Server | AtyponWS/7.1 | | Content-Encoding | gzip | | Last-Modified | Mon, 01 May 2017 22:55:39 GMT | | Expires | Thu, 19 Oct 2017 05:40:28 GMT | | Cache-Control | public | | Vary | User-Agent,Accept-Encoding | | Content-Type | text/css; charset=UTF-8 | | Transfer-Encoding | chunked | | Date | Tue, 02 May 2017 11:34:24 GMT | Regards Vasu On 3 May 2017 at 00:59, Ahmed Ashour <asa...@ya...> wrote: Hi Vasu, Please use latest version, if not latest build. And post your complete code. Ahmed From: Vasudevan Comandur <vco...@gm...> To: "htmlunit-user@lists. sourceforge.net" <htmlunit-user@lists. sourceforge.net> Sent: Tuesday, May 2, 2017 9:13 PM Subject: [Htmlunit-user] Clarification Requried Hi, I am using HTMLUnit 2.23. I received a response from the site which had page object mapped to instance of TextPage. I tried to get the content using getContent() method but I was not getting the data. The response code was 200 and the content-type was text/css. Am I missing something?. The site I am scrapping is http://adh.sagepub.com The CSS data which I was trying to read is http://journals.sagepub.com/ pb/css/t1493676764000- v1493676764000/head_1_6_7.css Appreciate your help in advance. Regards Vasu ------------------------------ ------------------------------ ------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ______________________________ _________________ Htmlunit-user mailing list Htmlunit-user@lists. sourceforge.net https://lists.sourceforge.net/ lists/listinfo/htmlunit-user ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot_______________________________________________ Htmlunit-user mailing list Htm...@li... https://lists.sourceforge.net/lists/listinfo/htmlunit-user |
From: Vasudevan C. <vco...@gm...> - 2017-05-02 20:30:41
|
Hi Ahmed, I had changed the HTTP Header Accept-Encoding to deflate and HTMLUnit 2.23 was reading the content. However, if I had left it to the default Accept-Encoding to gzip, deflate header, it was not giving me the content. Let me know if you need any other stuff from me. Response HEader from Host when defalte was set HTTP/1.1 200 OK Server AtyponWS/7.1 Last-Modified Mon, 01 May 2017 22:55:39 GMT Expires Thu, 19 Oct 2017 05:40:28 GMT Cache-Control public Vary User-Agent,Accept-Encoding Content-Type text/css; charset=UTF-8 Date Tue, 02 May 2017 20:23:20 GMT Content-Encoding deflate Transfer-Encoding chunked Response Header from Host when gzip was set HTTP/1.1 200 OK Server AtyponWS/7.1 Content-Encoding gzip Last-Modified Mon, 01 May 2017 22:55:39 GMT Expires Thu, 19 Oct 2017 05:40:28 GMT Cache-Control public Vary User-Agent,Accept-Encoding Content-Type text/css; charset=UTF-8 Transfer-Encoding chunked Date Tue, 02 May 2017 11:34:24 GMT Regards Vasu On 3 May 2017 at 00:59, Ahmed Ashour <asa...@ya...> wrote: > Hi Vasu, > > Please use latest version, if not latest build. > > And post your complete code. > > Ahmed > > > ------------------------------ > *From:* Vasudevan Comandur <vco...@gm...> > *To:* "htm...@li..." <htmlunit-user@lists. > sourceforge.net> > *Sent:* Tuesday, May 2, 2017 9:13 PM > *Subject:* [Htmlunit-user] Clarification Requried > > Hi, > > I am using HTMLUnit 2.23. I received a response from the site which had > page object mapped to instance of TextPage. I tried to get the content > using > getContent() method but I was not getting the data. The response code > was 200 > and the content-type was text/css. > > Am I missing something?. > > The site I am scrapping is http://adh.sagepub.com > <http://localhost:8080/jlf/search/generalredirect?rurl=http://adh.sagepub.com> > > The CSS data which I was trying to read is > http://journals.sagepub.com/pb/css/t1493676764000- > v1493676764000/head_1_6_7.css > > Appreciate your help in advance. > > Regards > Vasu > > ------------------------------------------------------------ > ------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > > |
From: Vasudevan C. <vco...@gm...> - 2017-05-02 19:54:30
|
Hi Ahmed, The call (getContent ()) which I am making to read the TextPage instance is correct I suppose. Regards Vasu On 3 May 2017 at 00:59, Ahmed Ashour <asa...@ya...> wrote: > Hi Vasu, > > Please use latest version, if not latest build. > > And post your complete code. > > Ahmed > > > ------------------------------ > *From:* Vasudevan Comandur <vco...@gm...> > *To:* "htm...@li..." <htmlunit-user@lists. > sourceforge.net> > *Sent:* Tuesday, May 2, 2017 9:13 PM > *Subject:* [Htmlunit-user] Clarification Requried > > Hi, > > I am using HTMLUnit 2.23. I received a response from the site which had > page object mapped to instance of TextPage. I tried to get the content > using > getContent() method but I was not getting the data. The response code > was 200 > and the content-type was text/css. > > Am I missing something?. > > The site I am scrapping is http://adh.sagepub.com > <http://localhost:8080/jlf/search/generalredirect?rurl=http://adh.sagepub.com> > > The CSS data which I was trying to read is > http://journals.sagepub.com/pb/css/t1493676764000- > v1493676764000/head_1_6_7.css > > Appreciate your help in advance. > > Regards > Vasu > > ------------------------------------------------------------ > ------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > > |
From: Ahmed A. <asa...@ya...> - 2017-05-02 19:33:26
|
Hi Vasu, Please use latest version, if not latest build. And post your complete code. Ahmed From: Vasudevan Comandur <vco...@gm...> To: "htm...@li..." <htm...@li...> Sent: Tuesday, May 2, 2017 9:13 PM Subject: [Htmlunit-user] Clarification Requried Hi, I am using HTMLUnit 2.23. I received a response from the site which had page object mapped to instance of TextPage. I tried to get the content using getContent() method but I was not getting the data. The response code was 200 and the content-type was text/css. Am I missing something?. The site I am scrapping is http://adh.sagepub.com The CSS data which I was trying to read is http://journals.sagepub.com/pb/css/t1493676764000-v1493676764000/head_1_6_7.css Appreciate your help in advance. Regards Vasu |
From: Vasudevan C. <vco...@gm...> - 2017-05-02 19:13:46
|
Hi, I am using HTMLUnit 2.23. I received a response from the site which had page object mapped to instance of TextPage. I tried to get the content using getContent() method but I was not getting the data. The response code was 200 and the content-type was text/css. Am I missing something?. The site I am scrapping is http://adh.sagepub.com <http://localhost:8080/jlf/search/generalredirect?rurl=http://adh.sagepub.com> The CSS data which I was trying to read is http://journals.sagepub.com/pb/css/t1493676764000-v1493676764000/head_1_6_7.css Appreciate your help in advance. Regards Vasu |
From: Ahmed A. <asa...@ya...> - 2017-05-02 08:00:38
|
Hi Ian, We have this error on the test suite as well, and the reason is because the client-side tries to connect to non-existing WebSocket URL. However, if you have this error, with a correct server-side part, then it needs to be tackled. Please try to isolate a minimal case as in https://sourceforge.net/p/htmlunit/code/HEAD/tree/trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/WebSocketTest.java#l41 Ahmed From: Ian Clarke <ian...@gm...> To: htm...@li... Sent: Monday, May 1, 2017 6:34 PM Subject: [Htmlunit-user] Help with UpgradeException #yiv7784256793 * a:hover{cursor:pointer;} #yiv7784256793 body {} _filtered #yiv7784256793 {}#yiv7784256793 to {position:relative;}#yiv7784256793 #yiv7784256793 a {word-wrap:normal;}#yiv7784256793 .yiv7784256793background-contain {background-size:contain;}@media screen and (max-width:600px){#yiv7784256793 .yiv7784256793container {}#yiv7784256793 .yiv7784256793container, #yiv7784256793 .yiv7784256793palm-one-whole {width:100% !important;min-width:100% !important;}#yiv7784256793 .yiv7784256793palm-one-half {width:50% !important;min-width:50% !important;}#yiv7784256793 blockquote .yiv7784256793container, #yiv7784256793 blockquote .yiv7784256793container div, #yiv7784256793 blockquote .yiv7784256793container table {width:auto !important;min-width:0 !important;position:relative;}#yiv7784256793 img {max-width:100%;}#yiv7784256793 .yiv7784256793border-outer, #yiv7784256793 .yiv7784256793border-middle, #yiv7784256793 .yiv7784256793border-inner, #yiv7784256793 .yiv7784256793inner, #yiv7784256793 .filtered99999 {width:100% !important;}#yiv7784256793 .yiv7784256793innercell {padding:8px !important;}#yiv7784256793 .yiv7784256793palm-block {display:block;}#yiv7784256793 td.yiv7784256793palm-one-whole {display:inline-block;padding:0;}#yiv7784256793 td.yiv7784256793palm-one-whole:first-child:not {margin-bottom:16px;}#yiv7784256793 td.yiv7784256793hostname {padding-top:3px !important;}}@media screen and (min-width:601px){#yiv7784256793 .yiv7784256793preview-card {max-width:600px !important;}}@media screen and ( _filtered_a )and ( _filtered_a )screen and ( _filtered_a )and ( _filtered_a )screen and ( _filtered_a )screen and ( _filtered_a )screen and ( _filtered_a ){#yiv7784256793 .yiv7784256793container {width:100% !important;min-width:100% !important;}#yiv7784256793 .yiv7784256793p, #yiv7784256793 .yiv7784256793small, #yiv7784256793 li, #yiv7784256793 font .filtered99999 , #yiv7784256793 font .filtered99999 {font-size:1em !important;}}@media screen and ( _filtered_a )and ( _filtered_a )screen and ( _filtered_a )and ( _filtered_a )screen and ( _filtered_a ){#yiv7784256793 .yiv7784256793message-wrapper {padding-top:6px;}#yiv7784256793 .yiv7784256793apple-only .filtered99999 {display:block;max-height:none !important;line-height:normal !important;overflow:visible;height:auto !important;width:100% !important;position:relative;}#yiv7784256793 .yiv7784256793no-apple {display:none;}#yiv7784256793 form {font-size:inherit;}#yiv7784256793 input .filtered99999 {height:43px;padding-left:4px !important;}#yiv7784256793 button:hover {cursor:pointer;}}@media screen and ( _filtered_a ){#yiv7784256793 .yiv7784256793apple-mail-form {display:block;background-color:white;}}#yiv7784256793 * .filtered99999 .yiv7784256793outlook-com-hidden {display:none;}#yiv7784256793 * .filtered99999 .yiv7784256793outlook-com-button {display:block;}#yiv7784256793 * .filtered99999 .yiv7784256793outlook-com-only {display:block;max-height:none !important;line-height:normal !important;overflow:visible;height:auto !important;width:100% !important;position:relative;}#yiv7784256793 .yiv7784256793ExternalClass {width:100%;}#yiv7784256793 .yiv7784256793ExternalClass .yiv7784256793outlook-com-button {display:block;}#yiv7784256793 .yiv7784256793ExternalClass button {height:auto;}#yiv7784256793 .yiv7784256793ExternalClass .yiv7784256793outlook-com-hidden {display:none;}#yiv7784256793 .yiv7784256793ExternalClass .yiv7784256793outlook-com-only {display:block;max-height:none !important;line-height:normal !important;overflow:visible;height:auto !important;width:100% !important;position:relative;}#yiv7784256793 .yiv7784256793ExternalClass .yiv7784256793ecxlabels {display:none;}#yiv7784256793 .yiv7784256793ExternalClass .yiv7784256793ecxlabels {display:none;}#yiv7784256793 .yiv7784256793ExternalClass .yiv7784256793ecxarrow {display:none;}#yiv7784256793 .yiv7784256793ExternalClass cite >div + div {padding:0 0 4px 0;}#yiv7784256793 .yiv7784256793ExternalClass .yiv7784256793h1 {padding-bottom:5px;}#yiv7784256793 .yiv7784256793ExternalClass .yiv7784256793h2 {padding-bottom:5px;}#yiv7784256793 .yiv7784256793ExternalClass .yiv7784256793h3 {padding-bottom:5px;}#yiv7784256793 .yiv7784256793ExternalClass .filtered99999 {width:280px !important;} | I seem to get this exception fairly consistently on startup. I'm using htmlunit to tests a page that is delivered to the client, and the client then connects to the server via a websocket. But it's unclear what the root cause is, here is the full exception: May 01, 2017 12:55:58 AM com.gargoylesoftware.htmlunit.javascript.host.WebSocket runSEVERE: WS connect errorjava.util.concurrent.ExecutionException: org.eclipse.jetty.websocket.api.UpgradeException: 0 null at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2237) at com.gargoylesoftware.htmlunit.javascript.host.WebSocket$1.run(WebSocket.java:151) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:672) at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:590) at java.lang.Thread.run(Thread.java:745)Caused by: org.eclipse.jetty.websocket.api.UpgradeException: 0 null at org.eclipse.jetty.websocket.client.WebSocketUpgradeRequest.onComplete(WebSocketUpgradeRequest.java:513) at org.eclipse.jetty.client.ResponseNotifier.notifyComplete(ResponseNotifier.java:193) at org.eclipse.jetty.client.ResponseNotifier.notifyComplete(ResponseNotifier.java:185) at org.eclipse.jetty.client.HttpExchange.notifyFailureComplete(HttpExchange.java:269) at org.eclipse.jetty.client.HttpExchange.abort(HttpExchange.java:240) at org.eclipse.jetty.client.HttpConversation.abort(HttpConversation.java:141) at org.eclipse.jetty.client.HttpRequest.abort(HttpRequest.java:735) at org.eclipse.jetty.client.HttpDestination.abort(HttpDestination.java:444) at org.eclipse.jetty.client.HttpDestination.close(HttpDestination.java:366) at org.eclipse.jetty.client.HttpClient.doStop(HttpClient.java:247) at org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:89) at org.eclipse.jetty.util.component.ContainerLifeCycle.stop(ContainerLifeCycle.java:142) at org.eclipse.jetty.util.component.ContainerLifeCycle.doStop(ContainerLifeCycle.java:160) at org.eclipse.jetty.websocket.client.WebSocketClient.doStop(WebSocketClient.java:376) at org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:89) at com.gargoylesoftware.htmlunit.javascript.host.WebSocket.close(WebSocket.java:347) at com.gargoylesoftware.htmlunit.javascript.host.WebSocket.close(WebSocket.java:325) at com.gargoylesoftware.htmlunit.html.HtmlPage.cleanUp(HtmlPage.java:328) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:516) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:394) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:311) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:459) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:444) at io.kweb.routing.RoutingSpec$1$3.invoke(RoutingSpec.kt:59) at io.kweb.routing.RoutingSpec$1$3.invoke(RoutingSpec.kt:20) at io.kotlintest.specs.FreeSpec.minus(FreeSpec.kt:23) at io.kweb.routing.RoutingSpec$1.invoke(RoutingSpec.kt:58) at io.kweb.routing.RoutingSpec$1.invoke(RoutingSpec.kt:20) at io.kotlintest.specs.FreeSpec.minus(FreeSpec.kt:23) at io.kweb.routing.RoutingSpec.<init>(RoutingSpec.kt:24) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:408) at java.lang.Class.newInstance(Class.java:438) at io.kotlintest.KTestJUnitRunner.<init>(KTestJUnitRunner.kt:9) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:408) at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:104) at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:86) at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59) at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26) at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59) at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:33) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:49) at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:51) at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)Caused by: java.nio.channels.AsynchronousCloseException ... 42 more May 01, 2017 12:56:13 AM com.gargoylesoftware.htmlunit.javascript.host.WebSocket runSEVERE: WS connect errorjava.lang.InterruptedException at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2225) at com.gargoylesoftware.htmlunit.javascript.host.WebSocket$1.run(WebSocket.java:151) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:672) at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:590) at java.lang.Thread.run(Thread.java:745) Process finished with exit code 0 Ian Clarkehttp://blog.locut.us/ | ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot_______________________________________________ Htmlunit-user mailing list Htm...@li... https://lists.sourceforge.net/lists/listinfo/htmlunit-user |
From: Ian C. <ian...@gm...> - 2017-05-01 16:34:17
|
I seem to get this exception fairly consistently on startup. I'm using htmlunit to tests a page that is delivered to the client, and the client then connects to the server via a websocket. But it's unclear what the root cause is, here is the full exception: May 01, 2017 12:55:58 AM com.gargoylesoftware.htmlunit.javascript.host.WebSocket runSEVERE: WS connect errorjava.util.concurrent.ExecutionException: org.eclipse.jetty.websocket.api.UpgradeException: 0 null at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2237) at com.gargoylesoftware.htmlunit.javascript.host.WebSocket$1.run(WebSocket.java:151) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:672) at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:590) at java.lang.Thread.run(Thread.java:745)Caused by: org.eclipse.jetty.websocket.api.UpgradeException: 0 null at org.eclipse.jetty.websocket.client.WebSocketUpgradeRequest.onComplete(WebSocketUpgradeRequest.java:513) at org.eclipse.jetty.client.ResponseNotifier.notifyComplete(ResponseNotifier.java:193) at org.eclipse.jetty.client.ResponseNotifier.notifyComplete(ResponseNotifier.java:185) at org.eclipse.jetty.client.HttpExchange.notifyFailureComplete(HttpExchange.java:269) at org.eclipse.jetty.client.HttpExchange.abort(HttpExchange.java:240) at org.eclipse.jetty.client.HttpConversation.abort(HttpConversation.java:141) at org.eclipse.jetty.client.HttpRequest.abort(HttpRequest.java:735) at org.eclipse.jetty.client.HttpDestination.abort(HttpDestination.java:444) at org.eclipse.jetty.client.HttpDestination.close(HttpDestination.java:366) at org.eclipse.jetty.client.HttpClient.doStop(HttpClient.java:247) at org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:89) at org.eclipse.jetty.util.component.ContainerLifeCycle.stop(ContainerLifeCycle.java:142) at org.eclipse.jetty.util.component.ContainerLifeCycle.doStop(ContainerLifeCycle.java:160) at org.eclipse.jetty.websocket.client.WebSocketClient.doStop(WebSocketClient.java:376) at org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:89) at com.gargoylesoftware.htmlunit.javascript.host.WebSocket.close(WebSocket.java:347) at com.gargoylesoftware.htmlunit.javascript.host.WebSocket.close(WebSocket.java:325) at com.gargoylesoftware.htmlunit.html.HtmlPage.cleanUp(HtmlPage.java:328) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:516) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:394) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:311) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:459) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:444) at io.kweb.routing.RoutingSpec$1$3.invoke(RoutingSpec.kt:59) at io.kweb.routing.RoutingSpec$1$3.invoke(RoutingSpec.kt:20) at io.kotlintest.specs.FreeSpec.minus(FreeSpec.kt:23) at io.kweb.routing.RoutingSpec$1.invoke(RoutingSpec.kt:58) at io.kweb.routing.RoutingSpec$1.invoke(RoutingSpec.kt:20) at io.kotlintest.specs.FreeSpec.minus(FreeSpec.kt:23) at io.kweb.routing.RoutingSpec.<init>(RoutingSpec.kt:24) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:408) at java.lang.Class.newInstance(Class.java:438) at io.kotlintest.KTestJUnitRunner.<init>(KTestJUnitRunner.kt:9) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:408) at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:104) at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:86) at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59) at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26) at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59) at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:33) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:49) at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:51) at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70) Caused by: java.nio.channels.AsynchronousCloseException ... 42 more May 01, 2017 12:56:13 AM com.gargoylesoftware.htmlunit.javascript.host.WebSocket runSEVERE: WS connect errorjava.lang.InterruptedException at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2225) at com.gargoylesoftware.htmlunit.javascript.host.WebSocket$1.run(WebSocket.java:151) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:672) at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:590) at java.lang.Thread.run(Thread.java:745) Process finished with exit code 0 Ian Clarkehttp://blog.locut.us/ |
From: Ahmed A. <asa...@ya...> - 2017-04-22 12:54:02
|
Hi Wayne, Thanks for reporting. It seems the bundle-plugin needs special maven configurations, which were locally applied. Please use the updated file and report back if you have an issue, with the full java code, since I had two ClassNotFoundException for: try (WebClient wc = new WebClient()) { wc.getPage("http://www.realestateatkochi.com/js/game/page/step1.html"); } Yours,Ahmed From: Wayne <way...@ho...> To: "Htm...@li..." <htm...@li...> Sent: Friday, April 21, 2017 12:31 AM Subject: [Htmlunit-user] NoSuchMethodError from htmlunit 2.26 (htmlunit-2.26-OSGi.jar) - packaging issue? <!--#yiv1657653571 _filtered #yiv1657653571 {font-family:"Cambria Math";panose-1:2 4 5 3 5 4 6 3 2 4;} _filtered #yiv1657653571 {font-family:DengXian;panose-1:2 1 6 0 3 1 1 1 1 1;} _filtered #yiv1657653571 {font-family:Calibri;panose-1:2 15 5 2 2 2 4 3 2 4;}#yiv1657653571 #yiv1657653571 p.yiv1657653571MsoNormal, #yiv1657653571 li.yiv1657653571MsoNormal, #yiv1657653571 div.yiv1657653571MsoNormal {margin:0in;margin-bottom:.0001pt;font-size:12.0pt;font-family:"Times New Roman";}#yiv1657653571 a:link, #yiv1657653571 span.yiv1657653571MsoHyperlink {color:blue;text-decoration:underline;}#yiv1657653571 a:visited, #yiv1657653571 span.yiv1657653571MsoHyperlinkFollowed {color:purple;text-decoration:underline;}#yiv1657653571 p.yiv1657653571msonormal, #yiv1657653571 li.yiv1657653571msonormal, #yiv1657653571 div.yiv1657653571msonormal {margin-right:0in;margin-left:0in;font-size:12.0pt;font-family:"Times New Roman";}#yiv1657653571 p.yiv1657653571msochpdefault, #yiv1657653571 li.yiv1657653571msochpdefault, #yiv1657653571 div.yiv1657653571msochpdefault {margin-right:0in;margin-left:0in;font-size:12.0pt;font-family:"Times New Roman";}#yiv1657653571 span.yiv1657653571msohyperlink {}#yiv1657653571 span.yiv1657653571msohyperlinkfollowed {}#yiv1657653571 span.yiv1657653571emailstyle17 {}#yiv1657653571 span.yiv1657653571msoins {}#yiv1657653571 p.yiv1657653571msonormal1, #yiv1657653571 li.yiv1657653571msonormal1, #yiv1657653571 div.yiv1657653571msonormal1 {margin:0in;margin-bottom:.0001pt;font-size:12.0pt;font-family:"Times New Roman";}#yiv1657653571 span.yiv1657653571msohyperlink1 {color:blue;text-decoration:underline;}#yiv1657653571 span.yiv1657653571msohyperlinkfollowed1 {color:purple;text-decoration:underline;}#yiv1657653571 span.yiv1657653571emailstyle171 {font-family:Calibri;color:windowtext;}#yiv1657653571 span.yiv1657653571msoins1 {color:teal;text-decoration:underline;}#yiv1657653571 p.yiv1657653571msochpdefault1, #yiv1657653571 li.yiv1657653571msochpdefault1, #yiv1657653571 div.yiv1657653571msochpdefault1 {margin-right:0in;margin-left:0in;font-size:10.0pt;font-family:"Times New Roman";}#yiv1657653571 span.yiv1657653571EmailStyle29 {font-family:Calibri;color:windowtext;}#yiv1657653571 span.yiv1657653571msoIns {text-decoration:underline;color:teal;}#yiv1657653571 .yiv1657653571MsoChpDefault {font-size:10.0pt;} _filtered #yiv1657653571 {margin:1.0in 1.0in 1.0in 1.0in;}#yiv1657653571 div.yiv1657653571WordSection1 {}-->Hi all, I’m wonder if I’m the only person who’s experiencing the following error. I googled online and it seems to be an old HC package that could cause this problem. I wonder if 2.26 OSGi was using an old http conn package? By the way, WebClient.getPage() on URL 'http://www.realestateatkochi.com/js/game/page/step1.html' would give IllegalStateError “Connection pool shut down” with ThreadedRefereshHandler on htmlunit-2.26-OSGi.jar. That’s why I’m trying 2.26. Thanks. -Wayne java.lang.NoSuchMethodError: org.apache.http.impl.conn.CPool.setValidateAfterInactivity(I)V at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.<init>(PoolingHttpClientConnectionManager.java:182) at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.<init>(PoolingHttpClientConnectionManager.java:164) at com.gargoylesoftware.htmlunit.HttpWebConnection.createConnectionManager(HttpWebConnection.java:1045) at com.gargoylesoftware.htmlunit.HttpWebConnection.getResponse(HttpWebConnection.java:176) at com.pan.utils.PandoraWebConnection.getResponse(PandoraWebConnection.java:36) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseFromWebConnection(WebClient.java:1372) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponse(WebClient.java:1291) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:390) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:311) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:459) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:444) at com.pan.utils.SingleCrawler$HtmlunitCrawl.call(SingleCrawler.java:1087) at com.pan.utils.SingleCrawler$HtmlunitCrawl.call(SingleCrawler.java:1007) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) NoSuchMethodError for 'http://www.realestateatkochi.com/js/game/page/step1.html' :org.apache.http.impl.conn.CPool.setValidateAfterInactivity(I)V ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot_______________________________________________ Htmlunit-user mailing list Htm...@li... https://lists.sourceforge.net/lists/listinfo/htmlunit-user |
From: Wayne <way...@ho...> - 2017-04-20 22:31:37
|
Hi all, I’m wonder if I’m the only person who’s experiencing the following error. I googled online and it seems to be an old HC package that could cause this problem. I wonder if 2.26 OSGi was using an old http conn package? By the way, WebClient.getPage() on URL 'http://www.realestateatkochi.com/js/game/page/step1.html' would give IllegalStateError “Connection pool shut down” with ThreadedRefereshHandler on htmlunit-2.26-OSGi.jar. That’s why I’m trying 2.26. Thanks. -Wayne java.lang.NoSuchMethodError: org.apache.http.impl.conn.CPool.setValidateAfterInactivity(I)V at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.<init>(PoolingHttpClientConnectionManager.java:182) at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.<init>(PoolingHttpClientConnectionManager.java:164) at com.gargoylesoftware.htmlunit.HttpWebConnection.createConnectionManager(HttpWebConnection.java:1045) at com.gargoylesoftware.htmlunit.HttpWebConnection.getResponse(HttpWebConnection.java:176) at com.pan.utils.PandoraWebConnection.getResponse(PandoraWebConnection.java:36) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseFromWebConnection(WebClient.java:1372) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponse(WebClient.java:1291) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:390) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:311) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:459) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:444) at com.pan.utils.SingleCrawler$HtmlunitCrawl.call(SingleCrawler.java:1087) at com.pan.utils.SingleCrawler$HtmlunitCrawl.call(SingleCrawler.java:1007) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) NoSuchMethodError for 'http://www.realestateatkochi.com/js/game/page/step1.html' :org.apache.http.impl.conn.CPool.setValidateAfterInactivity(I)V |
From: Ahmed A. <asa...@ya...> - 2017-04-19 10:00:16
|
Hi, You need to provide complete (hopefully tiny) case, so others can reproduce your issue. Please also read http://htmlunit.sourceforge.net/submittingJSBugs.html Ahmed From: jp_listero <jpl...@gm...> To: htm...@li... Sent: Tuesday, April 18, 2017 11:56 PM Subject: [Htmlunit-user] HtmlSelect doesnt trigger the events Hi there, I am building a spider for a web site that has two combo boxes, the first one populates the second one. this it is done with a java script: $('#gender').change(function () { if ($('#gender').val() == 'Female') { marital_options = ''; var selected = ''; $.each(marital_status_female, function (index, value) { if (value == 1) { selected = 'selected="selected"'; } else { selected = ''; } marital_options += '<option ' + selected + ' value="' + index + '">' + value + '</option>'; }); $('#marital_status').html('<select class="form-control" id="marital_status" name="marital_status">' + marital_options + '</select>'); this is my code try (final WebClient webClient = new WebClient(BrowserVersion.getDefault())) { webClient.setJavaScriptTimeout(5000); webClient.getOptions().setThrowExceptionOnScriptError(true); webClient.getOptions().setJavaScriptEnabled(true); webClient.waitForBackgroundJavaScript(30000); webClient.getOptions().setUseInsecureSSL(true); ... final HtmlSelect gender = page.getFirstByXPath("//*[@id=\"gender\"]"); gender.setSelectedAttribute(gender.getOptionByValue("Male"),Boolean.TRUE); final HtmlSelect marital_status = page.getFirstByXPath("//*[@id=\"marital_status\"]"); marital_status.getOptions(); // this is EMPTY Any clue how to make it works ? thank you in advance ! JP_Listero |