From: Marc G. <mgu...@ya...> - 2005-05-10 10:16:40
|
ok. The problem has been fixed since version 1.5 but not yet released. If you get the sources directly from CVS you will benefit of the last changes. Marc. Gael Harbonnier wrote: > A simple example: I start with www.google.com, I fill the form for a > htmlunit search, and so I want to get this url: > http://www.google.fr/search?hl=fr&q=htmlunit&btnG=Recherche+Google&meta= > > here's the source code: > > WebClient webClient = new WebClient(); > > HtmlPage pageCourrante = (HtmlPage)webClient.getPage( new > URL("http://www.google.com") ); > > webClient.setRedirectEnabled(false); > webClient.setJavaScriptEnabled(false); > > HtmlForm form = (HtmlForm)pageCourrante.getAllForms().get(0); > HtmlTextInput search= (HtmlTextInput)form.getInputByName("q"); > search.setValueAttribute("htmlunit"); > HtmlSubmitInput submit = > (HtmlSubmitInput)form.getInputByValue("Recherche Google"); > HtmlPage page = (HtmlPage)submit.click(); > System.out.println(page.getWebResponse().getUrl()); > > If you run that, it will print http://www.google.fr/search > > >> From: Marc Guillemot <mgu...@ya...> >> Reply-To: htm...@li... >> To: htm...@li... >> Subject: Re: [Htmlunit-user] Need to use a browser after an htmlUnit test >> Date: Tue, 10 May 2005 10:59:17 +0200 >> >> can you provide an example with the url you get and the one you expected? >> >> Marc. >> > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by Oracle Space Sweepstakes > Want to be the first software developer in space? > Enter now for the Oracle Space Sweepstakes! > http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > |