which headless browser automation is good?

+4 votes
Hi,

For my use case i should take screenshots, navigate pages, perform click, submit forms and i will be using java as programming language.

i have done some research on this.

I'm confused between these 6 options:

1. HTML Unit - a. is it possible to take screenshots?   b. is it possible to run htmlunit without using selenium?

2. PhantomJS - can we run it without unit ghostdriver/phantomjsdriver/selenium from java code?

3. CasperJs - a. can we run it from without using selenium from java code? b. do we need to install this software or just having it as a dependency will work?

4. SlimerJs -  a. can we run it from without using selenium from java code? b. do we need to install this software or just having it as a dependency will work?

5. Headless firefox - a. is it possible to run without installing browser b. can we run using java

6. Headless chrome - a. is it possible to run without installing browser b. can we run using java

7. Splash - a. can we run it from without using selenium from java code? b. do we need to install this software or just having it as a dependency will work?
Nov 29 in Selenium by Siva
• 160 points
48 views
Hey @Siva, that's a really brilliant query! This thread gave me a great deal of info. Thanks!

1 answer to this question.

0 votes

To answer your Queries:

1. HTML Unit

  • taking screenshots is possible but needs to be customized to do so. 

  • You could use Html unit  as a testing framework instead of selenium. But if you are talking about HTML Unit driver it is a selenium webdriver and can't be isolated from it.

2. PhantomJS

  • Ghostdriver is the bridge we need to use Selenium WebDriver with Phantom.JS. It is possible but to run it without any of these but, writing raw PhantomJS script is not everyone’s cup of tea. Harness the power of PhantomJS combined with a test framework of your choice. But the latest versions of the PhantomJS driver comes with built-in ghost driver.

  • PhantomJS supports these languages that you could choose from, JavaScript, Python, Ruby, Java, C#, Haskell, Objective-C, Perl, PHP, R(via Selenium)

3. CasperJs -

  • CasperJS is a navigation scripting & testing utility for the PhantomJS (WebKit) and SlimerJS (Gecko) headless browsers, written in Javascript.

  • CasperJS supports JavaScript. You can run it from without using selenium from java code. 

  • You need to install the software or, you can call a CasperJS script directly with the phantomjs executable, but if you do so, you must set the phantom.casperPath property to the path where the library root is located on your system.You can run such a script like any other standard PhantomJS script.

4. SlimerJs -

  • SlimerJS is similar to PhantomJs, except that it runs Gecko, the browser engine of Mozilla Firefox, instead of Webkit (And it is not yet truly headless).

  • It supports Javascript.

5. Headless firefox -

  • You need to have the browser installed.

  •  Yes, you could run using java.

6. Headless Chrome -

  • You could open the Chrome binary from the command line. You certainly need Chrome installed on whatever machine executes the tests.

  • You could run it using Java.

7. Splash

  • Splash is a javascript rendering service with an HTTP API. It's a lightweight browser with an HTTP API, implemented in Python using Twisted and QT.

  • Yes, it is possible to run it from without using selenium from java code. It supports a lot of languages that you could use. 

  • You need to first install docker on your OS and then pull splash image and run it to install splash.

Depending on which language/script you are comfortable with, you could choose the headless browser for automation as per your requirements.

Hope this helps!

answered Nov 29 by Karan
• 6,650 points

edited Nov 29 by Sirajul

Related Questions In Selenium

0 votes
2 answers
0 votes
0 answers
0 votes
1 answer

Which is better CSS or Xpath? Considering performance and cross browser testing

According to css has better performance compared ...READ MORE

answered Apr 17, 2018 in Selenium by Shubham
• 13,350 points
394 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,110 points
1,128 views
0 votes
1 answer
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,150 points
1,239 views
0 votes
1 answer

How to use such xpath to find web elements

It's much simpler to use: #MyDiv123 > div.super or ...READ MORE

answered Jun 14, 2018 in Selenium by Samarpit
• 5,150 points
988 views