From: Bandita P. <ban...@ya...> - 2008-07-30 15:00:39
|
Hi Robin, I tried to do mvn package and the build is successful. However, I am getting the same error XMLHttpRequest.send] ERROR com.gargoylesoftware.htmlunit.javascript.host.XMLHttpRequest - XMLHttpRequest.getResponseHeader() was called before the response was available. Also, i tried to put more time but the second/ricoLG_oddRow or data inside first row/ricoLG_evenRow is not coming. Please help. Thanks, Bandita ----- Original Message ---- From: Rabin Aryal <ra...@ne...> To: htm...@li... Sent: Tuesday, July 29, 2008 3:03:32 PM Subject: Re: [Htmlunit-user] table statement in htmlunit It seems that HtmlUnit is trying to access the header before it is loaded. Try to sleep for longer time may be for 2-3 minutes. Also download the source code of HtmlUnit and try to debug. See why it fails. ________________________________ From:htm...@li... [mailto:htm...@li...] On Behalf Of Bandita Pradhan Sent: Tuesday, July 29, 2008 4:03 PM To: htm...@li... Subject: Re: [Htmlunit-user] table statement in htmlunit Hi, I am not sure if following error is causing problem to get second row. Can you help me on this? 5094 [HtmlUnit Managed Thread #11: XMLHttpRequest.send] ERROR com.gargoylesoftware.htmlunit.javascript.host.XMLHttpRequest - XMLHttpRequest.getResponseHeader() was called before the response was available. 5094 [HtmlUnit Managed Thread #11: XMLHttpRequest.send] WARN com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine - warning: message=[Calling eval() with anything other than a primitive string value will simply return the value. Is this what you intended?] sourceName=[http://localhost:55500/nnm/js/ajax/prototype/prototype.js] line=[697] lineSource=[null] lineOffset=[0] 5094 [HtmlUnit Managed Thread #10: window.setTimeout] ERROR com.gargoylesoftware.htmlunit.javascript.host.XMLHttpRequest - XMLHttpRequest.getResponseHeader() was called before the response was available. 5094 [HtmlUnit Managed Thread #10: window.setTimeout] WARN com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine - warning: message=[Calling eval() with anything other than a primitive string value will simply return the value. Is this what you intended?] sourceName=[http://localhost:55500/nnm/js/ajax/prototype/prototype.js] line=[697] lineSource=[null] lineOffset=[0] Thanks, Bandita ----- Original Message ---- From: Rabin Aryal <ra...@ne...> To: htm...@li... Sent: Tuesday, July 29, 2008 7:05:06 AM Subject: Re: [Htmlunit-user] table statement in htmlunit Could you try increasing the time you sleep before you print out the page.asXml() and then see. IT doesnot make sense that it outputs only the even rows. From:htm...@li... [mailto:htm...@li...] On Behalf Of Bandita Pradhan Sent: Monday, July 28, 2008 4:44 PM To: htm...@li... Subject: Re: [Htmlunit-user] table statement in htmlunit Hi Robin, Even if I put tbody , it's not working for me. I tried to do page.asXml() method and i don't see ricoLG_oddRow nor the divs inside the div for ricoLG_evenRow. I am not sure but it could be because of Ajax it's causing some problem the way i put the Ajax statement below. Please help. Here is the code that I wrote to get the form/window. finalHtmlPage submitbtnclick = (HtmlPage) submitbutton.click(); WebWindow latestWindow = submitbtnclick.getEnclosingWindow(); HtmlPage mainPage = (HtmlPage) latestWindow.getEnclosedPage(); ClickableElement ifaceP = (ClickableElement) mainPage.getElementById("accordionContainer"); for( DomNode element: ifaceP.getChildren()) { // System.out.println("iface accordionContainer div " + element.getFirstChild().getNextSibling().getTextContent()); DomNode ivclick = element.getFirstChild().getNextSibling(); String iv = element.getFirstChild().getNextSibling().getTextContent(); if(iv.equals("Inventory")) { System.out.println(" get the xml for inventory" + ivclick.asXml()); if(ivclick instanceof ClickableElement) { /*final HtmlLabel label = (HtmlLabel)page.getHtmlElementById("testLabel"); label.click(); */ ClickableElement inventory = (ClickableElement)ivclick; System.out.println(" instance of ClickableElement" + inventory.getOnClickAttribute()); webClient.setAjaxController(new NicelyResynchronizingAjaxController()); Thread.sleep(20 * 1000); HtmlPage ivPage = (HtmlPage)inventory.click(); webClient.setAjaxController(new NicelyResynchronizingAjaxController()); Thread.sleep(20 * 1000); HtmlAnchor interfaceanchor = ivPage.getFirstAnchorByText("Interfaces"); System.out.println(" Interface anchor" + interfaceanchor.asXml()); HtmlPage interfacePage = (HtmlPage)interfaceanchor.click(); webClient.setAjaxController(new NicelyResynchronizingAjaxController()); Thread.sleep(20 * 1000); System.out.println(" Interface Page" + interfacePage.asXml()); Here is my output. I removed the thead part from my output since there is a limitation on the no. of bytes to send. <table class="ricoLG_table1" cellspacing="0" cellpadding="0" id="476b7d88-bb86-4e04-a768-f9cb8d4fbff1_table_tab1"> <tbody> <tr class="ricoLG_evenRow"> <td class="476b7d88-bb86-4e04-a768-f9cb8d4fbff1_table_col0" id="476b7d88-bb86-4e04-a768-f9cb8d4fbff1_table_1_0_0"> <div class="ricoLG_cell" style="width: 22px;"> </div> </td> <td class="476b7d88-bb86-4e04-a768-f9cb8d4fbff1_table_col1" id="476b7d88-bb86-4e04-a768-f9cb8d4fbff1_table_1_0_1"> <div class="ricoLG_cell" style="width: 22px;"> </div> </td> <td class="476b7d88-bb86-4e04-a768-f9cb8d4fbff1_table_col2" id="476b7d88-bb86-4e04-a768-f9cb8d4fbff1_table_1_0_2"> <div class="ricoLG_cell" style="width: 22px;"> </div> </td> <td class="476b7d88-bb86-4e04-a768-f9cb8d4fbff1_table_col3" id="476b7d88-bb86-4e04-a768-f9cb8d4fbff1_table_1_0_3"> <div class="ricoLG_cell" style="width: 22px;"> </div> </td> <td class="476b7d88-bb86-4e04-a768-f9cb8d4fbff1_table_col4" id="476b7d88-bb86-4e04-a768-f9cb8d4fbff1_table_1_0_4"> <div class="ricoLG_cell" style="width: 22px;"> </div> </td> <td class="476b7d88-bb86-4e04-a768-f9cb8d4fbff1_table_col5" id="476b7d88-bb86-4e04-a768-f9cb8d4fbff1_table_1_0_5"> <div class="ricoLG_cell" style="width: 22px;"> </div> </td> <td class="476b7d88-bb86-4e04-a768-f9cb8d4fbff1_table_col6" id="476b7d88-bb86-4e04-a768-f9cb8d4fbff1_table_1_0_6"> <div class="ricoLG_cell" style="width: 6px;"> </div> </td> <td class="476b7d88-bb86-4e04-a768-f9cb8d4fbff1_table_col7" id="476b7d88-bb86-4e04-a768-f9cb8d4fbff1_table_1_0_7"> <div class="ricoLG_cell" style="width: 66px;"> </div> </td> <td class="476b7d88-bb86-4e04-a768-f9cb8d4fbff1_table_col8" id="476b7d88-bb86-4e04-a768-f9cb8d4fbff1_table_1_0_8"> <div class="ricoLG_cell" style="width: 86px;"> </div> </td> <td class="476b7d88-bb86-4e04-a768-f9cb8d4fbff1_table_col9" id="476b7d88-bb86-4e04-a768-f9cb8d4fbff1_table_1_0_9"> <div class="ricoLG_cell" style="width: 51px;"> </div> </td> <td class="476b7d88-bb86-4e04-a768-f9cb8d4fbff1_table_col10" id="476b7d88-bb86-4e04-a768-f9cb8d4fbff1_table_1_0_10"> <div class="ricoLG_cell" style="width: 6px;"> </div> </td> <td class="476b7d88-bb86-4e04-a768-f9cb8d4fbff1_table_col11" id="476b7d88-bb86-4e04-a768-f9cb8d4fbff1_table_1_0_11"> <div class="ricoLG_cell" style="width: 51px;"> </div> </td> <td class="476b7d88-bb86-4e04-a768-f9cb8d4fbff1_table_col12" id="476b7d88-bb86-4e04-a768-f9cb8d4fbff1_table_1_0_12"> <div class="ricoLG_cell" style="width: 111px;"> </div> </td> <td class="476b7d88-bb86-4e04-a768-f9cb8d4fbff1_table_col13" id="476b7d88-bb86-4e04-a768-f9cb8d4fbff1_table_1_0_13"> <div class="ricoLG_cell" style="width: 6px;"> </div> </td> </tr> </tbody> </table> =/ |