PDA

View Full Version : How to take screenshots?



dylan.thomas
15 May 2017, 12:59 AM
I'm trying to take screenshots for the purpose of test auditing. Although there is a brief section in the docs regarding image comparison and the archive server, there doesn't appear to be any documentation regarding the screenshot function its parameters.

I've attempted a simple example running from the command line with an archive server;

it("is expected that a screenshot can be captured of the default screen", function() {
console.log("Taking screenshot...");
ST.screenshot("default screen", function() {
console.log("Screenshot callback...");
});
});

The callback is invoked, but to what purpose?

When running from the GUI, the test passes and I get a message that screenshots are not supported (as expected).

But, when running from the command line, the test fails with;

unknown error: cannot get automation extensionfrom unknown error: page could not be found: chrome-extension://aapnijgdinlhnhlmodcfapnahmbfebeb/_generated_background_page.html

joel.watson
18 May 2017, 7:02 AM
Hi Dylan--

What version of selenium server are you using, and which version of Chrome you are using? I've seen similar errors occur when an outdated version of the chromedriver is used with newer versions of Chrome. For example, chromedriver 2.24 stopped working consistently with versions of Chrome greater than 56, I believe. You might start with upgrading to the latest version of chromedriver (2.29) and see if that resolves the issues. Thanks!