Javascript capture()方法在casperjs中工作不正确

Javascript capture()方法在casperjs中工作不正确,javascript,casperjs,Javascript,Casperjs,casperjs捕获窗口的一部分。它发生在我在casperj中测试时截图时。我用 this.capture('google.png', { top: 0, left: 0, width: 1280, height: 960 }); 我也试过使用 this.capture('google.png'); 及 如何制作整个窗口(文档)的屏幕截图?这对我来说很有效,请尝试设置视口: var casper = require('casper').create ({

casperjs捕获窗口的一部分。它发生在我在casperj中测试时截图时。我用

this.capture('google.png', {
    top: 0,
    left: 0,
    width: 1280,
    height: 960
});
我也试过使用

this.capture('google.png');


如何制作整个窗口(文档)的屏幕截图?

这对我来说很有效,请尝试设置
视口

var casper = require('casper').create ({
  waitTimeout: 15000,
  stepTimeout: 15000,
  verbose: true,
  viewportSize: {
    width: 1280,
    height: 960
  },
  pageSettings: {
    "userAgent": 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.10 (KHTML, like Gecko) Chrome/23.0.1262.0 Safari/537.10',
    "webSecurityEnabled": false,
    "ignoreSslErrors": true
  },
  onWaitTimeout: function() {
      // casper.capture('./out/wait-timeout:_' + TimeTidy() + '.png');
      // throw new Error stuff;
  },
  onStepTimeout: function() {
      // casper.capture('./out/step-timeout' + TimeTidy() + '.png');
      // throw new Error stuff;
  }
});
然后使用:

casper.capture('google.png');
// or if within casper block:
// this.capture('google.png');
casper.capture('google.png');
// or if within casper block:
// this.capture('google.png');