TestProject Forum
Powered by leading experts in the test automation community

Can't take page screenshot with Screenshot Utils

My test fails with error for “Take page screenshot”:

java.util.concurrent.ExecutionException: io.testproject.java.sdk.v2.exceptions.FailureException: Failed to take a screenshot of the page
Caused by io.testproject.java.sdk.v2.exceptions.FailureException: Failed to take a screenshot of the page at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)

And in report, for “Take page screenshot”, Output: resultPath is empty.

I’m taking screenshots of element with “Take element screenshot” function from “Image Comparison” addon, and it’s works fine, but I need to take full page screenshots for my test.
image

Hello @btcbittest,
On which browser are you executing the test that take page element action is failing?
And may I ask if the site URL is public, so I could test it here?

Hey @itamar.klein
I’ve tried both chrome and firefox, in headless and standart regimes. I cant’t give you website url, because it’s local project, but I’ve tried to get screenshot of google’s main page and it’s still failing

P.S. Also adding screenshot of my test step parameters

Hello @btcbittest
Which OS are you using? Linux?
Also please try to give the full path in the FilePath field.

Hey @ran.tzur
Yes, I’m using Ubuntu linux 18.04.1. Path in FilePath field is full and “Take element screenshot” function from “Image Comparison” is working with it just fine.

Can you please send me your agent logs to support@testproject.io

@ran.tzur, could you, please, tell where agent stores logs on linux? I need to tell my system administrator where to look

Sure, you can find them ~/.testproject/agent/logs
Just zip them before.

@ran.tzur, sorry there is no such file or directory in agent folder :frowning: maybe i can add path to logs in config.json? If yes, then could you please tell me how?

Notice the . before testproject, it is a hidden folder.
~/.testproject/agent/logs

@ran.tzur sent logs to your support email :slight_smile: still no log folder in ~/.testproject/agent/, but i’ve managed to download logs from agent management page :slight_smile:

Hello @btcbittest
The problem is you have a . before the png
image

Please delete it.

1 Like

Damn, that really my bad :smiley: sorry, for the inconvenience, and thank you for great support :smiley:

In that case I have one more question. Is it possible to take full screenshot of webpage, not only visible part in my viewport? Like “Save full page” firefox? :slight_smile:

Sadly selenium works just like a user, meaning it can see what the user can see (the viewport)
So it can take a screenshot of only what is visible in the viewport.

You can always take a screenshot, scroll and take another.

Ok, got it :slight_smile: thank you again :slight_smile:

Hello again, I didn’t wanted to create another topic for this question, so… :sweat_smile:

Is it possible to choose image format in “Image Comparison” addon? It’s saving files in jpg, but I need them in png :slight_smile:

Do you mean the result of the comparison?
It saves in jpg but you can always convert it manually to png.

Yeah, that’s what i meant. It’s just not very convenient to run renaming script every time :slight_smile: thank you for answer :slight_smile:

I see, We will add a field for the format of the result file.

1 Like