From: Ahmed A. <asa...@ya...> - 2016-05-26 13:31:46
|
Hi, I assume TEST_WEB_PAGE is source.html. source.html contains: <script src="./wicket/resource/org.apache.wicket.resource.JQueryResourceReference/jquery/jquery-1.12.3-ver-1462804975000.js" type="text/javascript"/> <script src="./wicket/resource/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/res/js/wicket-event-jquery-ver-1462804975000.js" type="text/javascript"/> which are not public. Ideally, you put your files into a new webserver project, then test with HtmlUnit and real browser, to ensure your case is complete. Ahmed From: nonSonoPaola <non...@gm...> To: Ahmed Ashour <asa...@ya...> Cc: htm...@li... Sent: Thursday, May 26, 2016 3:22 PM Subject: Re: [Htmlunit-user] NaN values in htmlUnit getPage Hi, I attached the same files with public versions of shieldUi javascripts. Laura 2016-05-26 14:51 GMT+02:00 Ahmed Ashour <asa...@ya...>: You need to provide complete case, so others can see the results. What you have provided doesn't include the JavaScript files. Ahmed Am 26.05.2016 um 14:12 schrieb nonSonoPaola <non...@gm...>: Hi, thanks for your answer. Here is the Java code. public static void main(String[] args) throws Exception { WebClient webClient = null; OutputStream ostream = null; try { webClient = new WebClient(); final HtmlPage page = webClient.getPage(TEST_WEB_PAGE); System.out.println(page.asXml()); } finally { if (ostream != null) ostream.close(); if (webClient != null) webClient.close(); } } Laura 2016-05-26 10:23 GMT+02:00 Ahmed Ashour <asa...@ya...>: Hi Laura, Please post your complete Java code (hopefully minimal). Otherwise, you can debug HtmlUnit to see how it works. Ahmed From: nonSonoPaola <non...@gm...> To: htm...@li... Sent: Thursday, May 26, 2016 9:53 AM Subject: [Htmlunit-user] NaN values in htmlUnit getPage 'm trying to get a page html using htmlUnit library. I think some javascript are not executed properly, since I get Nan in some attribute values. I use this code for retrieving the page: webClient = new WebClient(); final HtmlPage page = webClient.getPage(TEST_WEB_PAGE); here is a fragment from the the output page.asXml() instruction (the anomaly happens in many tags): <svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="1256" height="362"> <defs> <clipPath id="shielddx"> <rect rx="0" ry="0" fill="none" x="0" y="0" width="9999" height="362" stroke-width="0"/> </clipPath> <clipPath id="shielddy"> <rect fill="none" x="0" y="0" width="NaN" height="NaN"/> </clipPath> </defs> ... If I open TEST_WEB_PAGE in a browser and I open the dev panel attributes are correctly filled up. TEST_WEB_PAGE has been created using Apache wiket and shieldUi. You can fin attached page source, html unit output and chrome page. Can anyone help me?Laura ------------------------------------------------------------------------------ Mobile security can be enabling, not merely restricting. Employees who bring their own devices (BYOD) to work are irked by the imposition of MDM restrictions. Mobile Device Manager Plus allows you to control only the apps on BYO-devices by containerizing them, leaving personal data untouched! https://ad.doubleclick.net/ddm/clk/304595813;131938128;j _______________________________________________ Htmlunit-user mailing list Htm...@li... https://lists.sourceforge.net/lists/listinfo/htmlunit-user |