Reputation: 1
I have little problem with making screenshot of whole page. Using webdriverio code such this (below, with firefox) makes me screenshot of whole page, but not with chrome. Author api says, that i need to use webdrivercss, but i dont know how. Anybody, pls help me. How i can change that code.
var webdriverio = require('webdriverio');
var options = {
desiredCapabilities: {
browserName: 'chrome'
}
};
var size;
webdriverio
.remote(options)
.init()
.windowHandleMaximize(false)
.url('http://webdriver.io/')
.saveScreenshot('./chrome.png')
.end();
For every help, i will be grateful
Upvotes: 0
Views: 1825
Reputation: 598
Here is an example:
var webdriverio = require('webdriverio');
var webdrivercss = require('webdrivercss');
var options = {
desiredCapabilities: {
browserName: 'chrome'
}
};
var browser = webdriverio.remote(options);
webdrivercss.init(browser, {
screenshotRoot: './',
screenWidth: [1024]
});
client.init()
.windowHandleMaximize(false)
.url('http://webdriver.io/')
.webdrivercss('chrome-screenshot', {
name:'some_id',
elem:'body'
}, function(err, res){}))
.saveScreenshot('chrome-screenshot')
.end();
For more information view the webdrivercss github. The documentation is lovely. I've had trouble with screenshots through the chromedriver. They don't render properly... but phantomjs worked well.
Upvotes: 3