Which version of PhantomJS do you use? Support for standard I/O was introduced in the 1.9 version.
Read more here: http://phantomjs.org/release-1.9.html
Question
I was kind of new to casperjs more specifically javascript on native enviroments, some casperjs script has the following code fragment that gives me error on executing:
system.stdout.write("Old \"" + password.name + "\" password: ");
var oldPassword = system.stdin.readLine().trim();
I tried to install commonjs npm library but does not solved my problem, I echoed the properties of available system library as follows:
for(var tmp in system){
console.log(tmp);
}
The out put is:
objectName
pid
args
env
os
isSSLSupported
destroyed(QObject*)
destroyed()
deleteLater()
_isCompletable()
_getCompletions(QString)
The first lines that execute the require commands as follows:
system = require('system');
casper = require('casper').create();
require = patchRequire(require, ['./adapters']);
config = require('./config').config;
And the complete source of the casperjs program I try to use is here passup.js
How can I solve this issue? I mean load system so that it has .stdout and .stdin properties. Any help would be appreciated.
Solution
Which version of PhantomJS do you use? Support for standard I/O was introduced in the 1.9 version.
Read more here: http://phantomjs.org/release-1.9.html