System.stdout and system.stdin undefined in casperjs

I was a bit new to casperjs, more specifically javascript in native environments, some casperjs script have the following code fragment that gives me an error while executing:

system.stdout.write("Old \"" + password.name + "\" password: "); var oldPassword = system.stdin.readLine().trim(); 

I tried to install commonjs npm library, but did not solve my problem, I repeated the properties of the available system library as follows:

 for(var tmp in system){ console.log(tmp); } 

Output:

 objectName pid args env os isSSLSupported destroyed(QObject*) destroyed() deleteLater() _isCompletable() _getCompletions(QString) 

The first lines that execute require commands are:

 system = require('system'); casper = require('casper').create(); require = patchRequire(require, ['./adapters']); config = require('./config').config; 

And the full source of the casperjs program that I am trying to use is here passup.js

How can I solve this problem? I mean the boot system so that it has the properties .stdout and .stdin. Any help would be appreciated.

+4
source share
1 answer

What version of PhantomJS are you using? Support for standard I / O was introduced in version 1.9.

More details here: http://phantomjs.org/release-1.9.html

+4
source

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


All Articles