私が代わりにFirefoxのデベロッパーツールを口論しようとしているのwebdriverを使用する2番目のラルフRの勧告ます。
低速ローカルカルーセルでWebページに移動し、要求したイメージが完全に読み込まれるとすぐにスクリーンショットを撮るwebdriverjsスクリプトです(このカルーセルで、CSS opacity
が1になるまで待つように指示します) 。あなたはあなたが持っている多くのスライド画像だけでこれをループすることができます。
var webdriver = require('selenium-webdriver');
var By = webdriver.By;
var until = webdriver.until;
var fs = require("fs");
var driver = new webdriver.Builder().forBrowser("chrome").build();
//Go to website
driver.get("http://output.jsbin.com/cerutusihe");
//Tell webdriver to wait until the opacity is 1
driver.wait(function(){
//first store the element you want to find in a variable.
var theEl = driver.findElement(By.css(".mySlides:nth-child(1)"));
//return the css value (it can be any value you like), then return a boolean (that the 'result' of the getCssValue request equals 1)
return theEl.getCssValue('opacity').then(function(result){
return result == 1;
})
}, 60000) //specify a wait of 60 seconds.
//call webdriver's takeScreenshot method.
driver.takeScreenshot().then(function(data) {
//use the node file system module 'fs' to write the file to your disk. In this case, it writes it to the root directory of my webdriver project.
fs.writeFileSync("pic2.png", data, 'base64');
});