What advantages and disadvantages to do the major browsers have when automating web applications



  • I am having trouble choosing a good browser when automating a web application. Among the browsers I have considered are Firefox, Chrome, Safari, PhantomJS

    I am particularly looking for comparisons of:

    • framework support, especially Selenium but also other frameworks
    • page/content loading time
    • execution speed
    • automation support
    • link navigation
    • opening other window or alert handling strategy

    What are the advantages and disadvantages of different browsers with respect to these areas?

    Currently I am using Firefox but I have observed issues like

    • overlong page loading time,
    • click does not always work when used with text/link text

    I have not been able to find a simple, understandable comparison of browser support for Selenium and related automation tools particularly in terms of how well they handle automation of important features like link navigation, filling out forms, managing alerts or popup windows, and so on.

    My project does not have any unusual functionality. I just want to be able to be able to build my automation cleanly.



  • The choice of a browser depends on your goal. If you are testing GUI rendering and JavaScript execution you should always tests against those browser that your users/customers are using. So even if, for instance, Internet Explorer is slow and unhandy, it make sense to test against it, while if you don't find any bug with PhantomJS it does not mean much, because no real user is using it. Having said that, here are my experiences.

    PhantomJS

    • I found PhantomJSDriver (called previously GhostDriver) particularly useful for testing SSL: checking whether a web site can verify a client certificate. With FirefoxDriver it requires pre-configuring a profile a certificate, with PhantomJS it is a matter of a few command-line parameters that can be passed at runtime.
    • The problem with PhantomJS (not the driver itself) is that it is released only once a year, so if you are waiting for a stable version with a bug fix, you need to compile a snapshot version yourself and it takes some time (20-30 minutes) to have it.
    • Some sources are claiming PhantomJS tests are significantly faster than in headful browsers, I haven't seen any credible benchmark proving that.
    • Finally, there are bugs that cannot be found with PhantomJS, see my another question: What bugs cannot be found with PhantomJS?.

    HtmlUnit

    • Another headless browser if you don't need a JavaScript support. The fastest browser I am aware of.
    • Comparison with PhantomJS can be found here.


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2