What are the advantages and disadvantages of using PhantomJS initially instead of Chrome via webdriver for QA functional testing?

We are testing a one-time application with one browser / connection (chrome) with the selenium web server for Chrome. Some suggest using PhantomJS for its speed because it is headless.

This web application is also a thick client for working with JavaScript. I want to know any advantages or disadvantages of using PhantomJS for this purpose.

+6
source share
3 answers

My opinion is that PhantomJS is not very mature for a large-scale project.

I used ChromeDriver, IE very widely for a fairly large payroll application. I studied PhantomJS for testing and exploring its benefits.

Pros and cons of using PhantomJS instead of real browsers

Pros:

  • Many people use PhantomJS because they are headless and avoid the extra overhead with a real browser.

  • You can run CI tests directly using this, and avoid Grid Hub relationships (or another similar mechanism), which is sometimes a little messy to handle

Minuses:

  • In PhantomJS

  • Although testing e2e and UI is mainly used to replicate user behavior, PhantomJs definitely does not.

  • There are several cases where PhantomJS fails, but other drivers work fine.

  • The Protractor team directly discourages the use of PhantomJS if you plan on doing this.

+3
source

If you are as connected with Chrome as you say, you should run Chrome.

PhantomJS no longer runs the same rendering engine as Chrome, since Blink was released, so running tests from PhantomJS will not provide an accurate idea of ​​how your site will work in Chrome (it may work the same, but there may be slight differences).

In addition, PhantomJS may run on Webkit, but it is a very old version of Webkit.

Bottom line: Blink = / = Webkit. Go to Chrome.

+2
source

PhantomJS has many unsolved problems, and the lack of active development in the project complicates the situation. Many websites do not load on PhantomJS.

You can try Chrome Headless. https://developers.google.com/web/updates/2017/04/headless-chrome

You can get the headless nature of PhantonJS and the core of Chrome. The best of both worlds.

0
source

Source: https://habr.com/ru/post/984639/


All Articles