HtmlUnit 2.4, a headless java browser, released

Discussions

News: HtmlUnit 2.4, a headless java browser, released

  1. HtmlUnit 2.4, a headless java browser, released (15 messages)

    A new release of the pure GUI-Less browser is available, which allows high-level manipulation of web pages, such as filling forms, clicking links, accessing attributes and values of specific elements within the pages, you do not have to create lower-level requests of TCP/IP or HTTP, but just getPage(url), find a hyperlink, click() and you have all the HTML, JavaScript, and Ajax are automatically processed. The most common use of HtmlUnit is test automation of web pages (even with complex JavaScript libraries, like jQuery and Google Web Toolkit), but sometimes it can be used for web scraping, or downloading website content. The main enhancements:
    • Improved JavaScript support, now all jQuery and Mochikit tests pass, adding to already supported GWT and Sarissa
    • Native ActiveX support
    • Initial applets handling
    • Support for Internet Explorer conditional comments
    • And as usual, various bug fixes
    You can find more information in the official website, the development team is looking forward to getting your feedback.

    Threaded Messages (15)

  2. Jmeter?[ Go to top ]

    I wonder how easily this could be implemented as a plugin to jmeter. I know one of the toughest thing about managing more dynamic apps and workflows are getting the regex's correct and hoping the pre-processors work. With something like HtmlUnit you wouldn't have to digg through the posts and responses (with the exception of assertions), just interface with the app more naturally. Sounds cool.
  3. Re: Jmeter?[ Go to top ]

    I believe as well that HtmlUnit has a great role to play in load testing (in fact some users already use it for this purpose). Personally I think that it is too low level to effectively write large test suites and I prefer to use WebTest for that. For a few month, I've started the integration of WebTest with JMeter: http://mguillem.wordpress.com/2008/05/23/webtesthtmlunit-integration-with-jmeter-started/ but I haven't made any progress since this date as I didn't find free time to work on it.
  4. Comparisons[ Go to top ]

    This sounds pretty nice, but I'd still be worried about differences in behavior between this and the browsers I'm actually targeting. I'm also curious if there are tools with similar functionality (whether Java-based or not).
  5. Re: Comparisons[ Go to top ]

    ... but I'd still be worried about differences in behavior between this and the browsers I'm actually targeting...
    From documentation: Specifying this BrowserVersion will change the user agent header that is sent up to the server and will change the behavior of some of the JavaScript.
    public void homePage_Firefox() throws Exception { final WebClient webClient = new WebClient(BrowserVersion.FIREFOX_2); final HtmlPage page = webClient.getPage("http://htmlunit.sourceforge.net"); assertEquals("HtmlUnit - Welcome to HtmlUnit", page.getTitleText()); }
  6. Re: Comparisons[ Go to top ]

    This sounds pretty nice, but I'd still be worried about differences in behavior between this and the browsers I'm actually targeting.
    That depends, if your web application doesn't use JavaScript or your application include jQuery, GWT, Mochikit, and/or sarissa, you will have exact behavior as FF2/FF3/IE6/IE7, because HtmlUnit tests already include actual test cases/examples of those libraries. If you use Prototype, Ext JS, Dojo, YUI, you will have some successful cases, and some unsuccessful ones. HtmlUnit has a real active community; some bugs are fixed in few hours if they are simple. If you have a minimal test case, expect a quick response.
  7. Responsive Web Design[ Go to top ]


    I certainly agree you. In fact you did a great job with your blog too, as you can see you have a lot of visitors and I am very excited with it coz your blog is interactive. Two thumbs up for you. Have a great day.

    Responsive Webdesign

  8. Re: Comparisons[ Go to top ]

    HtmlUnit is a great library, we can't get by without it. We have 100s of automated downloads that would require users to navigate websites and download reports. Websites targeted use heavy javascript and a mixture of plain html, jsp, coldfusion. We used HttpUnit years ago, that was probably the first hit on google at the time. But no one touched it for several years, so we moved off it and on to this library. I used another tool at one company called iMacros. It's not free and runs strictly on Windows. The only nice thing that you could do is record as you're clicking through the site. Although very simple, it's painful to write the HtmlUnit code for larger tests. One idea would be an automatic code generator via firefox addon that would generate a good starting point.
  9. Re: Comparisons[ Go to top ]

    ... One idea would be an automatic code generator via firefox addon that would generate a good starting point.
    Have you tried the WebTestRecorder firefox plugin? WebTest is a thin layer over the top of HtmlUnit which let's you write your tests in Ant (if you have folk comfortable with XML) or Groovy (if you have folk comfortable with Java or scripting). We use the latter as part of a testing DSL. We tend to heavily refactor what a recorder gives us but it makes a great start for tedious pages.
  10. Re: Comparisons[ Go to top ]

    No I haven't, that's basically what I was looking for, thx
  11. Re: Comparisons[ Go to top ]

    I believe that PushToTest (http://www.pushtotest.com/) can translate both TestGen4Web as well as Selenium tests into HtmlUnit tests
  12. Re: sesli[ Go to top ]

    When is that captcha going to be implemented again? At least this list has a nice selection... and transsexuals, so nobody feels left out.
  13. At first sight, from a very high level point of view, it looks like the JWebPane project (the GUI part) to come and the HtmlUnit (the non-GUI part) match well. May be an interesting match to come... Dominique http://www.jroller.com/dmdevito
  14. Compare with HTTPClient[ Go to top ]

    How does this compare with HttpClient (from Apache)? http://hc.apache.org/httpclient-3.x/ I have used HttpClient and I'm trying to find out if someone has used both so that they can compare and contrast the two tools. V
  15. Re: Compare with HTTPClient[ Go to top ]

    How does this compare with HttpClient (from Apache)?
    http://hc.apache.org/httpclient-3.x/
    HttpClient is actually used by HtmlUnit. HttpClient is a powerful library for lower layer HTTP requests, but doesn't handle JavaScript/browser objects/DOM etc, what are all handled by HtmlUnit.
  16. Thanks for your nice information[ Go to top ]

    I love this one.