4

I know that it is sound strange. The point is that I want a NodeJS app to control the browser. On the same time, I want to see the browser and be able to interact with it it, and see what it is doing in real-time.

If it is not possible in PhantomJS, there is any other way to control a dedicated browser from NodeJS. (dedicated browser I mean that I don't want to use my own personal Chrome)

Usage Case: For example, I want to test an app that requires "login". I don't want to test the login process. So I need to "login" manually, (let the browser to save the cookies), and then I will be able to run the tests using the same cookies of the logged in user.

In other words: Is it possible to interact with as browser that controlled by NodeJS? I need the option to show the browser and hide it (so it will work from desktop and headless servers)

Aminadav Glickshtein
  • 23,232
  • 12
  • 77
  • 117
  • After seen the answers, I don't like the title of my question. it is generally about any NodeJS headless browser module not specific about PhantomJS. Do you have any other suggestion? – Aminadav Glickshtein Jan 27 '17 at 07:30

1 Answers1

4

PhantomJS is a headless browser which means there is nothing to show.

Fortunately there are other options that may fit your workflow


NightmareJS is using Electron which is based on Google Chrome browser. You may make the browser visible:
var Nightmare = require('nightmare');       
var nightmare = Nightmare({ show: true });

SlimerJS is always visible, it's syntax-compatible with PhantomJS.

Vaviloff
  • 16,282
  • 6
  • 48
  • 56