Impressive WebDriver performance with HtmlUnit

A WebDriver user has recently posted interesting execution times for his test suite in HtmlUnit’s mailing list depending on the driven browser.

Here are his results for his 600 tests:

  • 2 hours: Sauce Labs
  • 40 minutes: Chrome
  • 10 minutes: HTMLUnit
  • 4 minutes: HTMLUnit + surefire plugin parallel execution

The complete email can be read here.

Of course this doesn’t mean at all that the HtmlUnitDriver is always faster than the “real” browsers. There are many cases where HtmlUnit is too slow, no discussion. Additionally more information would be interesting here to correctly interpret the execution times like the results when driving Firefox and the kind of browser simulated with HtmlUnit. Nevertheless such results are always encouraging for HtmlUnit’s developer.


  1. sandy said,

    December 12, 2012 at 10:13 am

    Hello Marc,
    Thanks for the wonderful Htmlunit. I have been using it thru selenium since long time. I have a issue now. I have started using selenium scripts with Jmeter for performance test, Jmeter works well with firefox driver, but its failing when I use HtmlUnitDriver in the Junit test. Can you please help?

  2. Amol said,

    December 27, 2012 at 9:50 am

    Hello Mark,

    I am trying to automate an application loaded with javascripts using HTMLUnitDriver. I observe that the performance is very low(apprx double time required) as compared to Chromedriver or Firefoxdriver.

    Could you please help.

  3. Timo said,

    February 13, 2013 at 10:34 am

    Hello Marc,

    I wonder if it isn’t comparing apples and oranges?
    Is this supposed to be a benchmark HTMLUnit vs. Browser Engines or just plain execution time of the tests?

    My guess is that the main advantage HTML Unit has over the other browser engines is that it runs in the same VM and doesn’t need any kind of interprocess call (e.g. JsonWireprotocol).

    That said it is still encouraging how much faster the whole test suite may run by switching the BackEnd to HTML Unit.

  4. Ahsan Saleem said,

    May 9, 2017 at 10:30 pm

    Hi, Do you have a solution for this problem ? (it seems to me that the scripts are unable to be executed.)
    maj 10, 2017 12:28:36 FM com.gargoylesoftware.htmlunit.javascript.StrictErrorReporter runtimeError
    SEVERE: runtimeError: message=[An invalid or illegal selector was specified (selector: ‘*,:x’ error: Invalid selector: :x).] sourceName=[] line=[3] lineSource=[null] lineOffset=[0]

  5. Anda said,

    June 6, 2017 at 3:29 am

    On the page ypu have broken links.
    Please modify.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: