CasperJS脚本仅在从自己从Java执行的shell脚本执行时才调用函数

时间:2016-07-27 20:10:21

标签: java bash shell phantomjs casperjs

我有一个用Casper.js编写的脚本。我正在使用Java Process来执行执行Casper脚本的shell脚本。

当我以这种方式执行时,几乎所有Casper脚本都会运行(由控制台日志和this.then(function() { this.click('input[type="type"]'); this.then(function() { this.page.uploadFile('input[type="type"]', 'picture.jpg'); this.then(function() { this.wait(1000); this.then(function() { var test = this.evaluate(function() { return document.getElementById('elementid').value; }); this.echo(test); return test; }); 命令确认),除了一个函数,我不知道为什么。这是一个片段:

test

未调用的函数是用于为变量{{1}}赋值的回调函数。

我在计算机上执行shell脚本时效果很好。只有从我的Java程序调用它时才会失败。

非常感谢您对此事的任何见解,谢谢!

0 个答案:

没有答案
相关问题