1
我在Windows下評估CasperJS的測試API。不幸的是,Casper對象的測試屬性總是未定義的。爲什麼[對象Casper] .test未定義?
運行下面的腳本打印 「this.test未定義」:
phantom.casperPath = 'D:\\GitHubSources\\casperjs';
phantom.injectJs(phantom.casperPath + '\\bin\\bootstrap.js');
var casper = require('casper').create();
casper.start('http://localhost:56679/index.html', function(){
this.echo('this.test is ' + this.test);
});
casper.run(function(){
this.exit();
});
任何提示?
NIKO,你說得對,我不小心用主分支。使用標籤1.0.0可以正常工作。感謝你傑出的工作! – paulroho