6

I'm using the below configurations:

Selenium 3.8.0

Java 8

Ubuntu 16.04

I have automated my Application and am running tests in the Chrome browser. I came to know about PhantomJS driver to run tests in headless mode and I'm able to run them using this.

But my questions are:

  1. PhantomJS is taking approximately the same time as Chrome to execute my whole test suite (approx 100 tests in around 40 min). So how it is faster? No doubt in cool feature like run your test without opening browser UI and see the result (compare result in report and also generate screenshots).

  2. How it is performance wise fast as I'm seeing approx same result in GUI and Headless mode?

  • 4
    You have a heuristic comparison and it doesn't appear to be faster. So what's your actual question? – FDM Dec 28 '17 at 13:17
  • @FDM, how it benefit us to execute test in headless mode. – NarendraR Dec 28 '17 at 13:57
  • Are you parallelizing your PhantomJS tests? – chrylis -on strike- Dec 28 '17 at 18:19
8

Phantom.js was abandoned, maintainer recommended to switch to headless Chrome.

Headless Chrome does not use CPU resources to repaint the screen, so try how many separate browser sessions you can run on same machine - you might not see the difference between just one headed and headless Chrome, it might be just few percent of the load.

5

I think Peter is right, it does not need the OS to draw the rendered page, might be some what faster. Something you will probably only notice if you run a lot in parallel.

But the main point is you can run it on a virtual machine without an Desktop Operating System, saving you lots of memory and thus costs as those VMs are much cheaper per hour.

Also if you are an developer it means you can run the tests in the background and not on the foreground which could block other application as the browser windows pop-up. Which saves you time and is thus faster :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.