Hi, I managed easily to make a screenshot with PhantomJS (headless Chrome browser). Here is the script if anybody has a use for it:
page.settings.userAgent = "Mozilla/5.0 (Windows NT x.y; rv:10.0) Gecko/20100101 Firefox/49.0";
function doLogin(){
page.evaluate(function(){
var frm = document.getElementById("loginForm");
frm.elements["username"].value = "myLogin";
frm.elements["password"].value = "XXXXXX";
frm.submit();
});
}
function screenshot(){
page.viewportSize = {
width: 1600,
height: 6000
};
page.open('http://192.168.38.123:8080/icescrum/p/SPHERE#sprintPlan', function() {
window.setTimeout(function () {
page.render('icescrum.png');
phantom.exit();
}, 2000); // wait 2s for javascript do update the graphic boxes
});
}
page.onLoadFinished = function(status){
console.log( (!phantom.state ? "no-state" : phantom.state) + ": " + status );
if(status === "success"){
if( !phantom.state ){
doLogin();
phantom.state = "logged-in";
} else if(phantom.state === "logged-in"){
screenshot();
phantom.state = "screenshot";
} else {
//console.log("ERROR: unhandled state... ");
}
}
};
page.onConsoleMessage = function (message){
console.log("msg: " + message);
};
page.open("http://192.168.0.1/icescrum/login");