test.js 448 B

1234567891011121314151617181920
  1. var brower = require('casper').create({
  2. pageSettings : {
  3. webSecurityEnabled : false
  4. },
  5. logLevel : "debug",// 日志等级
  6. verbose : true, // 记录日志到控制台
  7. onWaitTimeout : function() {
  8. this.echo('** Wait-TimeOut **');
  9. },
  10. onStepTimeout : function() {
  11. this.echo('** Step-TimeOut **');
  12. }
  13. });
  14. brower.start('http://www.mouser.cn/Mobile/', function() {
  15. this.echo(this.getTitle());
  16. this.capture('mouser.png');
  17. });
  18. brower.run();