From: Fab B. <swo...@ho...> - 2013-12-03 19:31:19
|
I fixed the first problem, now i can catch the element due to the js disabled, but I'm still struggling with the link preview, by the way i notice that if i use dblclick method on the text box, htmlunit throws an exception about javascript code. Suggestions? -----Messaggio originale----- From: Ronald Brill Sent: Tuesday, November 26, 2013 9:29 PM To: htm...@li... Subject: Re: [Htmlunit-user] Problems with Facebook TextBox Fab, usually all this fancy web sites are based on AJAX. So the page you finally got in your browser is the result of many request. Try to wait a bit after the login before you ask the WebClient for the current page again. In many cases this helps. For the wait code have a look at http://htmlunit.sourceforge.net/faq.html#AJAXDoesNotWork RBRi -------------------------- Wetator Smart web application testing http://www.wetator.org On Tue, 26 Nov 2013 21:22:51 +0100 Fab Brio wrote: > >Hi, > >I'm trying to build a application on Facebook with HtmlUnit, >So I want to log my profile, post contents on my wall and on groups pages. >I have no problem with the login procedure (I find the text boxes, i fill >them with name and password and I call "click" on the button. > >But I have problem with groups: I fail to grab the text box where I have to >write the message. > > >http://oi43.tinypic.com/28vszr6.jpg > >I proceed this way: > >java.util.logging.Logger.getLogger("com.gargoylesoftware").setLevel( > java.util.logging.Level.OFF); >WebClient client = new WebClient(BrowserVersion.getDefault()); >//log procedure... > >page = webClient.getPage("page_url"); >page.getElementByName("xhpc_message_text"); > >the last line throws an exception or returns null: HtmlUnit fails to find >the element. >I tried with the id (u_0_3a in this case) but it changes every time, the >name is always the same, so that's why I using name instead of id. > >How can I get the textbox element? > >The second problem is with the format in which facebook publish my content, >A normal post shows a title an icon etc. If I use HtmlUnit to fill the box >end click on the button to post it, fb shows only the string. >http://oi42.tinypic.com/2z703k0.jpg > >How can I fix it? > >I hope that someone have an answer for these problems. > ------------------------------------------------------------------------------ Rapidly troubleshoot problems before they affect your business. Most IT organizations don't have a clear picture of how application performance affects their revenue. With AppDynamics, you get 100% visibility into your Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk _______________________________________________ Htmlunit-user mailing list Htm...@li... https://lists.sourceforge.net/lists/listinfo/htmlunit-user |