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: jp_listero <jpl...@gm...> - 2017-04-18 21:56:29
|
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 |
From: Ahmed A. <asa...@ya...> - 2017-04-07 16:39:52
|
Hi, You must subscribe to the list before posting. Please provide your complete case. Try to use htmlPage.asXml() to see what HtmlUnit actually sees, before using XPath. Ahmed ----- Forwarded Message ----- From: "htm...@li..." <htm...@li...> To: htm...@li... Sent: Tuesday, April 4, 2017 7:06 PM Subject: Auto-discard notification The attached message has been automatically discarded. <!--#yiv0724119926 _filtered #yiv0724119926 {font-family:Wingdings;panose-1:5 0 0 0 0 0 0 0 0 0;} _filtered #yiv0724119926 {font-family:"Cambria Math";panose-1:2 4 5 3 5 4 6 3 2 4;} _filtered #yiv0724119926 {font-family:Calibri;panose-1:2 15 5 2 2 2 4 3 2 4;} _filtered #yiv0724119926 {font-family:Consolas;panose-1:2 11 6 9 2 2 4 3 2 4;}#yiv0724119926 #yiv0724119926 p.yiv0724119926MsoNormal, #yiv0724119926 li.yiv0724119926MsoNormal, #yiv0724119926 div.yiv0724119926MsoNormal {margin:0cm;margin-bottom:.0001pt;font-size:11.0pt;font-family:"Calibri", sans-serif;}#yiv0724119926 a:link, #yiv0724119926 span.yiv0724119926MsoHyperlink {color:#0563C1;text-decoration:underline;}#yiv0724119926 a:visited, #yiv0724119926 span.yiv0724119926MsoHyperlinkFollowed {color:#954F72;text-decoration:underline;}#yiv0724119926 p.yiv0724119926MsoListParagraph, #yiv0724119926 li.yiv0724119926MsoListParagraph, #yiv0724119926 div.yiv0724119926MsoListParagraph {margin-top:0cm;margin-right:0cm;margin-bottom:0cm;margin-left:36.0pt;margin-bottom:.0001pt;font-size:11.0pt;font-family:"Calibri", sans-serif;}#yiv0724119926 span.yiv0724119926EstiloCorreo17 {font-family:"Calibri", sans-serif;color:windowtext;}#yiv0724119926 .yiv0724119926MsoChpDefault {} _filtered #yiv0724119926 {margin:70.85pt 3.0cm 70.85pt 3.0cm;}#yiv0724119926 div.yiv0724119926WordSection1 {}#yiv0724119926 _filtered #yiv0724119926 {} _filtered #yiv0724119926 {font-family:"Calibri", sans-serif;} _filtered #yiv0724119926 {font-family:"Courier New";} _filtered #yiv0724119926 {font-family:Wingdings;} _filtered #yiv0724119926 {font-family:Symbol;} _filtered #yiv0724119926 {font-family:"Courier New";} _filtered #yiv0724119926 {font-family:Wingdings;} _filtered #yiv0724119926 {font-family:Symbol;} _filtered #yiv0724119926 {font-family:"Courier New";} _filtered #yiv0724119926 {font-family:Wingdings;}#yiv0724119926 ol {margin-bottom:0cm;}#yiv0724119926 ul {margin-bottom:0cm;}-->Hi guys, I have a doubt related to an error I´m getting in an automation implementing HtmlUnit. First of all, I have to mention that I´ve tried with all of the HtmlUnit jars between 16 and 25 versions and the htmlunit-core-js 13 and 23. Now I´m going to explain my problem. Once I login, the page brings me a form (this form with versions under 19 is empty) that has a button to submit to the dashboard page. The xml that corresponds to that button is: <div style="" class="content-item content-field item-2 " string_type="field" reserve_space="false"> <div class="content-inner "> <div class="field-item dataValueWrite"> <span> <button data-test-id="20160422002653026132438" type="button" class="pzhc" data-ctl="" data-click="[["showHarnessWrapper",["newDocument","UHG-FW-SRFW-Registration","CorporateInfo","RemovePages",":","pyDisplayHarness","Search","","No","",":event","","",""]]]"> <div class="pzbtn-rnd" data-click="."> <div class="pzbtn-lft" data-click=".."> <div class="pzbtn-rgt" data-click="..."> <div class="pzbtn-mid" data-click="...."> <img src="webwb/zblankimage.gif" alt="" class="pzbtn-i"/> Start Here <img alt="" src="webwb/zblankimage.gif" class="pzbtn-i"/> </div> </div> </div> </div> </button> </span> </div> </div> </div> But I can´t find the way to do click on that button and submit the form. I´ve tried with: - obtain the page and do an executeJavaScript getting the button of the document and clicking. - obtain the page and do an executeJavaScript getting the form and doing a submit. - doing HtmlForm form = page.getForms().get(0)and + HtmlButton button = getElementByClass(‘pzhc’)and button.click() + HtmlButton button = form.getByXPath("//*[@id='RULE_KEY']/div/div/div/div[2]/div/div/div/div/div[2]/div/div/div/div/div[2]/div/div/span/button").get(0);(this is the Xpath of the button) - creating a new button and adding to the form already obtained and doing click(). The basic problem here is that it´s having different behaviours in the browser and when I run it locally. For example, in the next image we can see the iframe with some tags inside it And the results of my execution locally is this <iframe name="PegaGadget0Ifr" id="PegaGadget0Ifr" border="0" frameborder="0" src="/prweb/CRExternal/ve_AdGnzk0tVEkWf1tHNZHTq26F5ROOf*/!TABTHREAD0?pyActivity=%40baseclass.doUIAction&action=display&harnessName=SRHome&className=UHG-FW-SRFW-Registration&label=Home&contentID=120e5c3c-4618-4ee3-a08b-a6030e23c4f6&dynamicContainerID=2cbea17f-ad84-4400-b112-2963b67d1848&tabIndex=1&portalThreadName=STANDARD&portalName=ProviderRegistration&pzHarnessID=HID4383C93F2B956C890CD840879440FB7A"> </iframe> The problem is that locally is bringing me the iframe empty. The main question is if anyone of you have you had this behaviuor previously. Some tips to consider: - Depending on the version of the jar, the results of some parts like getPage or getForm are different. - The page is using Angular. - The jars between 22 to 25 is bringing me this error: http://errors.angularjs.org/1.5.7/$rootScope/inprog?p0=%24digest (https://healthid.optum.com/tb/static/js/lib-min.js#7) of class com.gargoylesoftware.htmlunit.ScriptException where it expected String, Number, Boolean or Scriptable instance. Please check your code for missing Context.javaToJS() call. RHINO USAGE WARNING: Missed Context.javaToJS() conversion: Rhino runtime detected object com.gargoylesoftware.htmlunit.ScriptException: Error: [$rootScope:inprog] $digest already in progress The jars 16 to 21 is not bringing it. - After every ‘getPage()’ sentence, I add this lines before continuing with the manipulation of the page webClient.waitForBackgroundJavaScript(20000); webClient.waitForBackgroundJavaScriptStartingBefore(10000); I will appreciate very much any help! Thanks in advance, Best regards. Agustin. |
From: Ahmed A. <asa...@ya...> - 2017-04-04 08:15:22
|
Hi all, It is a pleasure to announce the availability of HtmlUnit 2.26. This is a maintenance release, and the list of changes can be found in [1]. Enjoy surfing! The HtmlUnit team [1] http://htmlunit.sourceforge.net/changes-report.html#a2.26 |
From: jplistero <jpl...@gm...> - 2017-04-02 11:56:08
|
Hi there, nevermind, issue solved with this setup: webClient.setAjaxController(new NicelyResynchronizingAjaxController()); full setup try (final WebClient webClient = new WebClient(BrowserVersion.getDefault())) { webClient.setJavaScriptTimeout(15000); webClient.getOptions().setJavaScriptEnabled(true); webClient.getOptions().setThrowExceptionOnScriptError(false); webClient.getOptions().setCssEnabled(false); webClient.setAjaxController(new NicelyResynchronizingAjaxController()); webClient.getOptions().setThrowExceptionOnScriptError(false); .... best -- View this message in context: http://htmlunit.10904.n7.nabble.com/click-doesn-t-work-tp41322p41343.html Sent from the HtmlUnit - General mailing list archive at Nabble.com. |
From: jplistero <jpl...@gm...> - 2017-04-02 11:31:06
|
Hi Andreas, did you solve this ? I am struggeling with the same issue. best -- View this message in context: http://htmlunit.10904.n7.nabble.com/Submit-form-with-javascript-AJAX-tp29256p41342.html Sent from the HtmlUnit - General mailing list archive at Nabble.com. |
From: jplistero <jpl...@gm...> - 2017-03-31 16:39:17
|
Hi asashour, thank you for the support, I read it, I understand that I need to isolate the problem, add alert anotations, etc. I'm very new to this and I don't get how to isolate the java script and where is the Java script ... I am only see the A4J.AJAX.Submit ... Can you help me with this ? best -- View this message in context: http://htmlunit.10904.n7.nabble.com/click-doesn-t-work-tp41322p41330.html Sent from the HtmlUnit - General mailing list archive at Nabble.com. |
From: Ahmed A. <asa...@ya...> - 2017-03-31 14:58:15
|
Hi, I guess you have fully read .http://htmlunit.sourceforge.net/submittingJSBugs.html To find the offending line, you can put alert() at various places, compare the result of HtmlUnit to a real browser (Chrome, Firefox or Internet Explorer), and you will mostly be able to provide a tiny failing test case which contains few lines of JavaScript (independent of the whole JavaScript library), please have a look at some sample test cases. Once the cause is identified, it is very likely to be fixed in a timely manner. From: jplistero <jpl...@gm...> To: htm...@li... Sent: Friday, March 31, 2017 4:06 PM Subject: Re: [Htmlunit-user] click doesn't work Hi I am not sure how to do it for this case, this is de code for the button: <input class="botonSub" id="commandConsultar" name="commandConsultar" onclick="A4J.AJAX.Submit('_viewRoot','form',event,{'similarityGroupingId':'commandConsultar','parameters':{'commandConsultar':'commandConsultar'} ,'actionUrl':'/ConsultaCFE/form/consultarCuenta.jsf;jsessionid=EDB70DE7649D858CA52C25C1855C8F9D'} );return false;" value="Consultar >>" type="button"> Kind of lost here, I am not sure what else try it. thank you in advance. -- View this message in context: http://htmlunit.10904.n7.nabble.com/click-doesn-t-work-tp41322p41328.html Sent from the HtmlUnit - General mailing list archive at Nabble.com. ------------------------------------------------------------------------------ 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: jplistero <jpl...@gm...> - 2017-03-31 14:06:37
|
Hi I am not sure how to do it for this case, this is de code for the button: <input class="botonSub" id="commandConsultar" name="commandConsultar" onclick="A4J.AJAX.Submit('_viewRoot','form',event,{'similarityGroupingId':'commandConsultar','parameters':{'commandConsultar':'commandConsultar'} ,'actionUrl':'/ConsultaCFE/form/consultarCuenta.jsf;jsessionid=EDB70DE7649D858CA52C25C1855C8F9D'} );return false;" value="Consultar >>" type="button"> Kind of lost here, I am not sure what else try it. thank you in advance. -- View this message in context: http://htmlunit.10904.n7.nabble.com/click-doesn-t-work-tp41322p41328.html Sent from the HtmlUnit - General mailing list archive at Nabble.com. |
From: Ahmed A. <asa...@ya...> - 2017-03-31 11:28:34
|
Hi Wayne, Check RefreshHandler, and HtmlPage.executeRefreshIfNeeded() I guess it would be easier for you to use the following workaround: new Exception().getStackTrace() And then see which StackTraceElement suits your need, e.g. is it called from Window.setLocation, or from somewhere else? Ahmed From: Wayne <way...@ho...> To: Ahmed Ashour <asa...@ya...>; "Htm...@li..." <htm...@li...> Sent: Friday, March 31, 2017 7:31 AM Subject: Re: [Htmlunit-user] how to get redirect chain #yiv7655422312 #yiv7655422312 -- _filtered #yiv7655422312 {font-family:Arial;panose-1:2 11 6 4 2 2 2 2 2 4;} _filtered #yiv7655422312 {panose-1:2 4 5 3 5 4 6 3 2 4;} _filtered #yiv7655422312 {font-family:DengXian;panose-1:2 1 6 0 3 1 1 1 1 1;} _filtered #yiv7655422312 {font-family:Calibri;panose-1:2 15 5 2 2 2 4 3 2 4;} _filtered #yiv7655422312 {panose-1:2 0 5 3 0 0 0 2 0 4;}#yiv7655422312 #yiv7655422312 p.yiv7655422312MsoNormal, #yiv7655422312 li.yiv7655422312MsoNormal, #yiv7655422312 div.yiv7655422312MsoNormal {margin:0in;margin-bottom:.0001pt;font-size:12.0pt;}#yiv7655422312 a:link, #yiv7655422312 span.yiv7655422312MsoHyperlink {color:blue;text-decoration:underline;}#yiv7655422312 a:visited, #yiv7655422312 span.yiv7655422312MsoHyperlinkFollowed {color:purple;text-decoration:underline;}#yiv7655422312 span.yiv7655422312EmailStyle17 {font-family:Calibri;color:windowtext;}#yiv7655422312 span.yiv7655422312msoIns {text-decoration:underline;color:teal;}#yiv7655422312 .yiv7655422312MsoChpDefault {font-size:10.0pt;} _filtered #yiv7655422312 {margin:1.0in 1.0in 1.0in 1.0in;}#yiv7655422312 div.yiv7655422312WordSection1 {}#yiv7655422312 Thank you very much Ahmed. Reading the loadWebResponseFromWebConnection() was helpful. That seems to only show the 30X redirection. I wonder where I find <meta http-equiv=”refresh…”/> redirect and javascript redirect (window.location). -Wayne From: Ahmed Ashour <asa...@ya...> Reply-To: Ahmed Ashour <asa...@ya...>, "Htm...@li..." <htm...@li...> Date: Thursday, March 30, 2017 at 4:04 PM To: "Htm...@li..." <htm...@li...> Subject: Re: [Htmlunit-user] how to get redirect chain Hi Wayne, The logic is in WebClient.loadWebResponseFromWebConnection(). I am afraid there is no currently way to exactly know, except by copying the method on your code and do the same checking. Hope that helps, Ahmed From: Wayne <way...@ho...> To: "Htm...@li..." <Htm...@li...> Sent: Thursday, March 30, 2017 8:14 PM Subject: [Htmlunit-user] how to get redirect chain Hi, I’m new to the alias and this may be an old topic. When I retrieve a page using htmlunit, there are usually some level of redirections. I would like to get the full redirection chain. One suggestion is the overwrite the HttpWebConnection. However, all I have is a WebRequest and WebResponse. public WebResponse getResponse(WebRequest request) throws IOException { super(request); } I have 2 problems: 1. It’s hard for me to tell if the web request is the original entry page. Or is it from loading a resource in the middle of parsing a non-entry page. I’m missing the “enclosed page” that triggered the http connection. 2. In the response, I could try to parse and get the href. But I wonder if the redirect response is not well formatted, how do I guarantee the href I got is the page the parse is going to visit. Wonder if anybody has been successful in retrieving the redirect chain. Thanks a lot. -Wayne ------------------------------------------------------------------------------ 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 ------------------------------------------------------------------------------ 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 ------------------------------------------------------------------------------ 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-03-31 05:30:49
|
Thank you very much Ahmed. Reading the loadWebResponseFromWebConnection() was helpful. That seems to only show the 30X redirection. I wonder where I find <meta http-equiv=”refresh…”/> redirect and javascript redirect (window.location). -Wayne From: Ahmed Ashour <asa...@ya...> Reply-To: Ahmed Ashour <asa...@ya...>, "Htm...@li..." <htm...@li...> Date: Thursday, March 30, 2017 at 4:04 PM To: "Htm...@li..." <htm...@li...> Subject: Re: [Htmlunit-user] how to get redirect chain Hi Wayne, The logic is in WebClient.loadWebResponseFromWebConnection(). I am afraid there is no currently way to exactly know, except by copying the method on your code and do the same checking. Hope that helps, Ahmed ________________________________ From: Wayne <way...@ho...> To: "Htm...@li..." <Htm...@li...> Sent: Thursday, March 30, 2017 8:14 PM Subject: [Htmlunit-user] how to get redirect chain Hi, I’m new to the alias and this may be an old topic. When I retrieve a page using htmlunit, there are usually some level of redirections. I would like to get the full redirection chain. One suggestion is the overwrite the HttpWebConnection. However, all I have is a WebRequest and WebResponse. public WebResponse getResponse(WebRequest request) throws IOException { super(request); } I have 2 problems: 1. It’s hard for me to tell if the web request is the original entry page. Or is it from loading a resource in the middle of parsing a non-entry page. I’m missing the “enclosed page” that triggered the http connection. 2. In the response, I could try to parse and get the href. But I wonder if the redirect response is not well formatted, how do I guarantee the href I got is the page the parse is going to visit. Wonder if anybody has been successful in retrieving the redirect chain. Thanks a lot. -Wayne ------------------------------------------------------------------------------ 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...<mailto:Htm...@li...> 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: Ahmed A. <asa...@ya...> - 2017-03-30 23:07:25
|
Hi Wayne, The logic is in WebClient.loadWebResponseFromWebConnection(). I am afraid there is no currently way to exactly know, except by copying the method on your code and do the same checking. Hope that helps, Ahmed From: Wayne <way...@ho...> To: "Htm...@li..." <Htm...@li...> Sent: Thursday, March 30, 2017 8:14 PM Subject: [Htmlunit-user] how to get redirect chain Hi, I’m new to the alias and this may be an old topic. When I retrieve a page using htmlunit, there are usually some level of redirections. I would like to get the full redirection chain. One suggestion is the overwrite the HttpWebConnection. However, all I have is a WebRequest and WebResponse. public WebResponse getResponse(WebRequest request) throws IOException { super(request); } I have 2 problems: 1. It’s hard for me to tell if the web request is the original entry page. Or is it from loading a resource in the middle of parsing a non-entry page. I’m missing the “enclosed page” that triggered the http connection. 2. In the response, I could try to parse and get the href. But I wonder if the redirect response is not well formatted, how do I guarantee the href I got is the page the parse is going to visit. Wonder if anybody has been successful in retrieving the redirect chain. Thanks a lot. -Wayne ------------------------------------------------------------------------------ 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-03-30 23:02:13
|
Hi, You need to isolate a minimal case, please read http://htmlunit.sourceforge.net/submittingJSBugs.html Ahmed From: jp_listero <jpl...@gm...> To: htm...@li... Sent: Thursday, March 30, 2017 8:18 PM Subject: [Htmlunit-user] click doesn't work Hi there, I am spidering a web page ... but click() doesnt work, or doesn't navigate ... Any clue what could be the issue ? I'm using 2.25 version this my code: @Testpublic String getFacturas() throws Exception { try (final WebClient webClient = new WebClient(BrowserVersion. getDefault())) { webClient. setJavaScriptTimeout(15000); webClient.getOptions(). setThrowExceptionOnScriptError (false); webClient.getOptions(). setJavaScriptEnabled(false); webClient. waitForBackgroundJavaScript( 30000); webClient.getOptions(). setActiveXNative(true); webClient.getOptions(). setAppletEnabled(true); webClient.getOptions(). setCssEnabled(true); webClient.getOptions(). setUseInsecureSSL(true); webClient.getOptions(). setRedirectEnabled(true); // add to log variable //toLog.append(" contrato: ").append(numeroContrato); final HtmlPage consultaCuentaPage = webClient.getPage("https:// wse-prod.antel.com.uy/ ConsultaCFE/form/ consultarCuenta.jsf"); // grab first form final HtmlForm consultarCuentaForm = consultaCuentaPage.getForms(). get(0); // numero cuenta input final HtmlInput numeroCuentaInput = consultarCuentaForm. getInputByName("nroCuenta"); // consultar button final HtmlInput consultarButton = consultarCuentaForm. getInputByName(" commandConsultar"); // Change the value of the text field numeroCuentaInput. setValueAttribute(" 16000455000231"); // Now submit the form by clicking the button and get back the second page. final HtmlPage consultaCuentaPage2 = consultarButton.click(); LOG.info("time: " + consultaCuentaPage2. getWebResponse().getLoadTime() ); // LOG.info("time: " + consultaCuentaPage2. getWebResponse(). getContentAsString()); //System.out.println( consultaCuentaPage2.asText()); ////*[@id="form"]/div[1]/ fieldset/table/tbody/tr[1]/td[ 1] if (consultaCuentaPage2. getFirstByXPath("//*[@id=\" form\"]/div[1]/fieldset/table/ tbody/tr[1]/td[1]") != null) { return ((HtmlTableDataCell) consultaCuentaPage2. getFirstByXPath("//*[@id=\" form\"]/div[1]/fieldset/table/ tbody/tr[1]/td[1]")).asText(); } } return null; } best regards ! ------------------------------------------------------------------------------ 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: jp_listero <jpl...@gm...> - 2017-03-30 18:18:07
|
Hi there, I am spidering a web page ... but click() doesnt work, or doesn't navigate ... Any clue what could be the issue ? I'm using 2.25 version this my code: @Test public String getFacturas() throws Exception { try (final WebClient webClient = new WebClient(BrowserVersion.getDefault())) { webClient.setJavaScriptTimeout(15000); webClient.getOptions().setThrowExceptionOnScriptError(false); webClient.getOptions().setJavaScriptEnabled(false); webClient.waitForBackgroundJavaScript(30000); webClient.getOptions().setActiveXNative(true); webClient.getOptions().setAppletEnabled(true); webClient.getOptions().setCssEnabled(true); webClient.getOptions().setUseInsecureSSL(true); webClient.getOptions().setRedirectEnabled(true); // add to log variable //toLog.append(" contrato: ").append(numeroContrato); final HtmlPage consultaCuentaPage = webClient.getPage("https:// wse-prod.antel.com.uy/ConsultaCFE/form/consultarCuenta.jsf"); // grab first form final HtmlForm consultarCuentaForm = consultaCuentaPage.getForms().get(0); // numero cuenta input final HtmlInput numeroCuentaInput = consultarCuentaForm. getInputByName("nroCuenta"); // consultar button final HtmlInput consultarButton = consultarCuentaForm.getInputByName(" commandConsultar"); // Change the value of the text field numeroCuentaInput.setValueAttribute("16000455000231"); // Now submit the form by clicking the button and get back the second page. *final HtmlPage consultaCuentaPage2 = consultarButton.click();* LOG.info("time: " + consultaCuentaPage2.getWebResponse().getLoadTime()); // LOG.info("time: " + consultaCuentaPage2.getWebResponse(). getContentAsString()); //System.out.println(consultaCuentaPage2.asText()); ////*[@id="form"]/div[1]/fieldset/table/tbody/tr[1]/td[1] if (consultaCuentaPage2.getFirstByXPath("//*[@id=\" form\"]/div[1]/fieldset/table/tbody/tr[1]/td[1]") != null) { return ((HtmlTableDataCell)consultaCuentaPage2.getFirstByXPath("//*[@id=\" form\"]/div[1]/fieldset/table/tbody/tr[1]/td[1]")).asText(); } } return null; } best regards ! |
From: Wayne <way...@ho...> - 2017-03-30 18:13:48
|
Hi, I’m new to the alias and this may be an old topic. When I retrieve a page using htmlunit, there are usually some level of redirections. I would like to get the full redirection chain. One suggestion is the overwrite the HttpWebConnection. However, all I have is a WebRequest and WebResponse. public WebResponse getResponse(WebRequest request) throws IOException { super(request); } I have 2 problems: 1. It’s hard for me to tell if the web request is the original entry page. Or is it from loading a resource in the middle of parsing a non-entry page. I’m missing the “enclosed page” that triggered the http connection. 2. In the response, I could try to parse and get the href. But I wonder if the redirect response is not well formatted, how do I guarantee the href I got is the page the parse is going to visit. Wonder if anybody has been successful in retrieving the redirect chain. Thanks a lot. -Wayne |
From: Ronald B. <rb...@rb...> - 2017-03-16 19:33:15
|
Hi Manjo, i know that hunting for memory leaks is not that simple. But believe me it is nearly impossible to do based on screen shots. HtmlUnit is maintained in our spare time - this implies that you have to help us a bit if you like to have any support. 1. please try to use the latest SNAPSHOT build. The quality of the snapshot builds is the same as the release build because they are done only if the whole test suite is green. There is no time for us to support older versions 2. We need more details. In your case you have to figure out, which collection is your problem. And we have to know, which entries are inside and why this is not correct. And we need the page source code to be able to understand your problem. 3. In general there is a good chance to get a fix if you are able to nail down the problem to the root cause. Hope that helps - waiting for your details to make HtmlUnit better RBRi -------------------------- WETATOR Smart web application testing http://www.wetator.org |
From: manojsakarwal <man...@in...> - 2017-03-16 14:48:26
|
Hi, We did profiling of our systems to investigate the memory leaks with HTML Unit(2.24). We found that one of the object of HTML Page is using 2 GB of memory. Following are the screenshots. Can you help us to find out why it is eating that much of memory. <http://htmlunit.10904.n7.nabble.com/file/n41146/image_%281%29.png> <http://htmlunit.10904.n7.nabble.com/file/n41146/image_%282%29.png> <http://htmlunit.10904.n7.nabble.com/file/n41146/image273.png> Thanks, Manoj Sakarwal -- View this message in context: http://htmlunit.10904.n7.nabble.com/Re-HTMLUnit-2-23-100-CPU-Utilization-and-memory-issues-tp40587p41146.html Sent from the HtmlUnit - General mailing list archive at Nabble.com. |
From: Ahmed A. <asa...@ya...> - 2017-03-15 07:41:19
|
Hi Marcelo, A build was made successful (by skipping tests, since we have another issue at the moment). Hope you find it useful,Ahmed From: Marcelo Tamassia <tam...@gm...> To: htm...@li... Sent: Tuesday, March 14, 2017 4:46 PM Subject: Re: [Htmlunit-user] Issues after upgrade from 2.13 to 2.25 (Internet explorer) Ahmed, thank you very much for the prompt reply and fix. It looks like the latest passing build on Team City is from March 1st so I will be checking it periodically to obtain a snapshot that includes the fix. |
From: Rural H. <rur...@gm...> - 2017-03-15 01:55:28
|
<html> <head> <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"> </head> <body bgcolor="#FFFFFF" text="#000000"> <div class="moz-cite-prefix">Thanks and congratulations!<br> <br> 在 2017/2/23 20:11, Ahmed Ashour 写道:<br> </div> <blockquote cite="mid:207...@ma..." type="cite"> <div style="color:#000; background-color:#fff; font-family:HelveticaNeue-Light, Helvetica Neue Light, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px"> <div id="yui_3_16_0_ym19_1_1487784242242_72923">Hi all,</div> <div id="yui_3_16_0_ym19_1_1487784242242_72922"><br> </div> <div id="yui_3_16_0_ym19_1_1487784242242_72921">It is a pleasure to announce the availability of HtmlUnit 2.25, which is the first release to required Java 8.</div> <div id="yui_3_16_0_ym19_1_1487784242242_72921"><br> </div> <div id="yui_3_16_0_ym19_1_1487784242242_72921">The most notable changes are:</div> <div id="yui_3_16_0_ym19_1_1487784242242_72921" dir="ltr"> - InteractivePage and SvgPage are removed, use HtmlPage</div> <div id="yui_3_16_0_ym19_1_1487784242242_72921" dir="ltr"> - Clicking a hidden element now does nothing</div> <div id="yui_3_16_0_ym19_1_1487784242242_72921" dir="ltr"> - PromptHandler: handlePrompt now has a third parameter</div> <div id="yui_3_16_0_ym19_1_1487784242242_72921" dir="ltr"> - Change return type of WebRequest.getCharset, WebResponse.getContentCharset(), .getContentCharsetOrNull(), and DomNode.getByXPath.</div> <div id="yui_3_16_0_ym19_1_1487784242242_72921" dir="ltr"> - ScriptPreProcessor was re-introduced</div> <div id="yui_3_16_0_ym19_1_1487784242242_72921" dir="ltr"> - WebClientOptions: add option to automatically download images.</div> <div id="yui_3_16_0_ym19_1_1487784242242_72921" dir="ltr"> - HtmlFileInput: have .setFiles() instead of .setValueAttribute()</div> <div id="yui_3_16_0_ym19_1_1487784242242_72921" dir="ltr"><br> </div> <div id="yui_3_16_0_ym19_1_1487784242242_72921" dir="ltr">The fill list of changes can be found in [1]</div> <div id="yui_3_16_0_ym19_1_1487784242242_72921" dir="ltr"><br> </div> <div id="yui_3_16_0_ym19_1_1487784242242_72921" dir="ltr">As always: Happy Coding!</div> <div id="yui_3_16_0_ym19_1_1487784242242_72921" dir="ltr"><br> </div> <div id="yui_3_16_0_ym19_1_1487784242242_72921" dir="ltr">The HtmlUnit team</div> <div id="yui_3_16_0_ym19_1_1487784242242_72921" dir="ltr"><br> </div> <div id="yui_3_16_0_ym19_1_1487784242242_72921" dir="ltr"><br> </div> <div id="yui_3_16_0_ym19_1_1487784242242_72921" dir="ltr">[1] <a moz-do-not-send="true" href="http://htmlunit.sourceforge.net/changes-report.html#a2.25" class="" id="yui_3_16_0_ym19_1_1487784242242_73325">http://htmlunit.sourceforge.net/changes-report.html#a2.25</a></div> <div id="yui_3_16_0_ym19_1_1487784242242_73334"><br> </div> <div id="yui_3_16_0_ym19_1_1487784242242_73367"><br> </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> <br> <p><br> </p> </body> </html> |
From: Marcelo T. <tam...@gm...> - 2017-03-14 15:47:45
|
Ahmed, thank you very much for the prompt reply and fix. It looks like the latest passing build on Team City is from March 1st so I will be checking it periodically to obtain a snapshot that includes the fix. On Tue, Mar 14, 2017 at 3:20 AM, < htm...@li...> wrote: > Date: Tue, 14 Mar 2017 07:17:44 +0000 (UTC) > From: Ahmed Ashour <asa...@ya...> > Subject: Re: [Htmlunit-user] Issues after upgrade from 2.13 to 2.25 > (Internet explorer) > To: "htm...@li..." > <htm...@li...> > Message-ID: <651...@ma...> > Content-Type: text/plain; charset="utf-8" > > Hi Marcelo, > Thanks for reporting, it is fixed in SVN. > This is due to incorrect handling of upper case attributes with IE.?If the > TYPE attribute is 'type', then HtmlUnit works correctly, but not if it is > upper case. > Yours,Ahmed > > From: Marcelo Tamassia <tam...@gm...> > To: htm...@li... > Sent: Tuesday, March 14, 2017 12:37 AM > Subject: [Htmlunit-user] Issues after upgrade from 2.13 to 2.25 (Internet > explorer) > > After upgrading from 2.13 to 2.25, I am experiencing issues when detecting > and populating input field when simulating IE (or Edge). > More specifically, it seems like 2.25 is detecting the password?input > fields as regular Input fields. The issues does not occur when simulating > Firefox or Chrome. The underlying HTML code is identical regardless of the > browser I am using, so it seems like HTMLUnit is behaving differently with > IE for a reason I can't explain. > ?I am accessing the element via ?HtmlPasswordInput inputPassword = > (HtmlPasswordInput) page.getHtmlElementById("Password");?and that is > throwing a java.lang.ClassCastException: com.gargoylesoftware.htmlunit.html.HtmlTextInput > cannot be cast to com.gargoylesoftware.htmlunit.html.HtmlPasswordInput > Here is how the HTML piece looks like when I browser via IE: > <table class="mainLoginTable" id="mainLoginTable" role="presentation">? > <tbody>?? ? <tr class="signInTextRow">? ? ? <td class="loginlabel">Sign > In</td>? ? </tr>? ? <tr>? ? ? <td><LABEL FOR="User">User ID</LABEL></td>? ? > ? <td><INPUT ?SIZE=20 class="textfield margin-top5" ? TYPE=text NAME="User" > ID="User" VALUE="" ></td>? ? </tr>? ? <tr>? ? ? <td>? ? ? ? <LABEL > FOR="Password">Password</LABEL>? ? ? </td>? ? ? <td>? ? ? ? <INPUT > AUTOCOMPLETE="OFF" SIZE=20 maxlength="40" class="textfield margin-top5" > TYPE=password NAME="Password" ID="Password" VALUE="">? ? ? </td>? ? </tr>? > ? ? <tr>? ? ? ? <td class="loginButton" colspan=2>?? ? ? ? ? ? <INPUT > ?class="buttonstylenormal margin-top5" ? TYPE=submit VALUE="Sign In" > onclick="return isFirstClick()">? ? ? ? </td>? ? ? </tr></tbody></table> > Is anyone else simulating IE and filling up passwords on forms with 2.25 > and experiencing the same issue? > > Thanks,Marcelo > -------------- next part -------------- > An HTML attachment was scrubbed... > > ------------------------------ > > ------------------------------------------------------------ > ------------------ > 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-03-14 07:20:45
|
Hi Marcelo, Thanks for reporting, it is fixed in SVN. This is due to incorrect handling of upper case attributes with IE. If the TYPE attribute is 'type', then HtmlUnit works correctly, but not if it is upper case. Yours,Ahmed From: Marcelo Tamassia <tam...@gm...> To: htm...@li... Sent: Tuesday, March 14, 2017 12:37 AM Subject: [Htmlunit-user] Issues after upgrade from 2.13 to 2.25 (Internet explorer) After upgrading from 2.13 to 2.25, I am experiencing issues when detecting and populating input field when simulating IE (or Edge). More specifically, it seems like 2.25 is detecting the password input fields as regular Input fields. The issues does not occur when simulating Firefox or Chrome. The underlying HTML code is identical regardless of the browser I am using, so it seems like HTMLUnit is behaving differently with IE for a reason I can't explain. I am accessing the element via HtmlPasswordInput inputPassword = (HtmlPasswordInput) page.getHtmlElementById("Password"); and that is throwing a java.lang.ClassCastException: com.gargoylesoftware.htmlunit.html.HtmlTextInput cannot be cast to com.gargoylesoftware.htmlunit.html.HtmlPasswordInput Here is how the HTML piece looks like when I browser via IE: <table class="mainLoginTable" id="mainLoginTable" role="presentation"> <tbody> <tr class="signInTextRow"> <td class="loginlabel">Sign In</td> </tr> <tr> <td><LABEL FOR="User">User ID</LABEL></td> <td><INPUT SIZE=20 class="textfield margin-top5" TYPE=text NAME="User" ID="User" VALUE="" ></td> </tr> <tr> <td> <LABEL FOR="Password">Password</LABEL> </td> <td> <INPUT AUTOCOMPLETE="OFF" SIZE=20 maxlength="40" class="textfield margin-top5" TYPE=password NAME="Password" ID="Password" VALUE=""> </td> </tr> <tr> <td class="loginButton" colspan=2> <INPUT class="buttonstylenormal margin-top5" TYPE=submit VALUE="Sign In" onclick="return isFirstClick()"> </td> </tr></tbody></table> Is anyone else simulating IE and filling up passwords on forms with 2.25 and experiencing the same issue? Thanks,Marcelo |
From: Marcelo T. <tam...@gm...> - 2017-03-13 23:38:26
|
After upgrading from 2.13 to 2.25, I am experiencing issues when detecting and populating input field when simulating IE (or Edge). More specifically, it seems like 2.25 is detecting the password input fields as regular Input fields. The issues does not occur when simulating Firefox or Chrome. The underlying HTML code is identical regardless of the browser I am using, so it seems like HTMLUnit is behaving differently with IE for a reason I can't explain. I am accessing the element via HtmlPasswordInput inputPassword = (HtmlPasswordInput) page.getHtmlElementById("Password"); and that is throwing a java.lang.ClassCastException: com.gargoylesoftware.htmlunit.html.HtmlTextInput cannot be cast to com.gargoylesoftware.htmlunit.html.HtmlPasswordInput *Here is how the HTML piece looks like when I browser via IE:* <table class="mainLoginTable" id="mainLoginTable" role="presentation"> <tbody> <tr class="signInTextRow"> <td class="loginlabel">Sign In</td> </tr> <tr> <td><LABEL FOR="User">User ID</LABEL></td> <td><INPUT SIZE=20 class="textfield margin-top5" TYPE=text NAME="User" ID="User" VALUE="" ></td> </tr> <tr> <td> <LABEL FOR="Password">Password</LABEL> </td> <td> <INPUT AUTOCOMPLETE="OFF" SIZE=20 maxlength="40" class="textfield margin-top5" TYPE=password NAME="Password" ID="Password" VALUE=""> </td> </tr> <tr> <td class="loginButton" colspan=2> <INPUT class="buttonstylenormal margin-top5" TYPE=submit VALUE="Sign In" onclick="return isFirstClick()"> </td> </tr> </tbody> </table> Is anyone else simulating IE and filling up passwords on forms with 2.25 and experiencing the same issue? Thanks, Marcelo |
From: Kevin M. <kma...@ad...> - 2017-03-07 19:37:44
|
After upgrading from version 2.20 to 2.25 I see a new Promise() releated error. Can anyone shed light? [junit] TypeError: Cannot find function race in object function Promise() { [native code] }. (https://use.typekit.net/qae4mec.js#33) [junit] ======= EXCEPTION START ======== [junit] EcmaError: lineNumber=[33] column=[0] lineSource=[null] name=[TypeError] sourceName=[https://use.typekit.net/qae4mec.js] message=[TypeError: Cannot find function race in object function Promise() { [native code] }. (https://use.typekit.net/qae4mec.js#33)] [junit] com.gargoylesoftware.htmlunit.ScriptException: TypeError: Cannot find function race in object function Promise() { [native code] }. (https://use.typekit.net/qae4mec.js#33) [junit] at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:894) [junit] at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:628) [junit] at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:515) [junit] at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:824) [junit] at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:796) thanks -Kevin -- Kevin Matassa | Adobe Sign<https://acrobat.adobe.com/mena/en/sign.html> | 1.613.940.3612 | kma...@ad... |
From: Ahmed A. <asa...@ya...> - 2017-03-07 07:25:43
|
Hi José, Please post to the user-list instead. Any error you get? Please ensure you use latest HtmlUnit version, and post your complete case (with URL), so others can reproduce the issue. Thanks,Ahmed From: José Lacerda <jos...@gm...> To: htm...@li... Sent: Monday, March 6, 2017 7:52 PM Subject: [HtmlUnit] Click Ajax Button Hello, I am need help. - Driver Configured: webClient.setAjaxController(new NicelyResynchronizingAjaxController()); webClient.getOptions().setJavaScriptEnabled(true); webClient.getOptions().setThrowExceptionOnScriptError(true); webClient.getOptions().setCssEnabled(true); - Navigation is done to this point that I need to click to open a new page:<a href="#" id="fPP:processosTable:333708:clAP" name="fPP:processosTable:333708:clAP" onclick="A4J.AJAX.Submit('fPP',event,{'similarityGroupingId':'fPP:processosTable:333708:clAP','parameters':{'fPP:processosTable:333708:clAP':'fPP:processosTable:333708:clAP','ajaxSingle':'fPP:processosTable:333708:clAP','idProcessoSelecionado':333708} } );return false;" title="Abrir Paginador"><img src="/pje/img/view.gif" style="cursor:pointer"></a> - My solution does not get the new page after the click:formularioSearch = paginaRespostaSearch.getFormByName("fPP");webClient.waitForBackgroundJavaScript(10000); HtmlAnchor anchor = (HtmlAnchor) paginaRespostaSearch.getElementById("fPP:processosTable:333708:clAP");webClient.waitForBackgroundJavaScript(10000);HtmlPage novaAba = anchor.click();webClient.waitForBackgroundJavaScript(10000); - What is lack? -- José Lacerda (+55) (83) 98700-5885 |
From: Ahmed A. <asa...@ya...> - 2017-03-01 10:12:22
|
Hi, An option has been added in WebClientOptions to get/set the screen width/height. You can get latest build from https://ci.canoo.com/teamcity/viewLog.html?buildTypeId=HtmlUnit_FastBuild&buildId=lastFinished&tab=artifacts Enjoy,Ahmed From: webb <d8...@si...> To: htm...@li... Sent: Wednesday, March 1, 2017 9:42 AM Subject: Re: [Htmlunit-user] how can I use JsxSetter? Ahmed, Thank you for your review! but I want to set the Screen before got response, Because before this javaScript had got the Screen parameters. is there a way I can set? thank you again |
From: Ahmed A. <asa...@ya...> - 2017-03-01 07:24:42
|
Hi, @JsxSetter is meant to be called from JavaScript. However, you can use the internal API, by something like: HtmlPage page = webClient.getPage(some_url); HTMLDocument document = (HTMLDocument) page.getScriptableObject(); Screen screen = document.getWindow().getScreen(); screen.setWidth(1234); Hope that helps,Ahmed From: webb <d8...@si...> To: htmlunit-user <htm...@li...> Sent: Wednesday, March 1, 2017 3:26 AM Subject: [Htmlunit-user] how can I use JsxSetter? Dear Sir, I have some questions, the screen.java in Htmlunit, the value of Height is 768, the value of Width is 1024, but wo want to change it when the WebClient creating, I want to set some parameters of the screen, what should I do? I'm looking forward to your reply soon. Sincerely yours, webb |