嘿,在selinium webdriver nodejs中获取全屏截图的命令是什么。
这是我的代码:
var webdriver = require('selenium-webdriver');
By = require('selenium-webdriver').By;
until = require('selenium-webdriver').untill;
fs = require('fs');
var chromedriver = require('chromedriver');
firefox = require('selenium-webdriver/firefox');
var Capabilities = require('selenium-webdriver/lib/capabilities').Capabilities;
var capabilities = Capabilities.firefox();
capabilities.set('marionette', true);
//driver = new FirefoxDriver();
var driver = new webdriver.Builder().withCapabilities(capabilities).build();
driver.manage().window().maximize();
driver.manage().deleteAllCookies();
driver.get('http://iolearn.com');
driver.takeScreenshot().then(function(data){
fs.writeFileSync('img.png',data,'base64');
});
driver.quit();