I have created a Maven/Java project for the QA test automation of a web app. I use Selenium, JUnit and a bunch of other dependencies like AShot, which I use for taking screenshots.
I developed the project in my home computer (2013 13-inch MacBook Pro) and all was well when I run the project, the screenshots looked fine.
However, when I downloaded the project to my work computer (a 2017 13-inch MacBook Pro) I started to get cut screenshots. I would only see half of the screen in the screenshots. Very weird. For reference, this is what the cut screenshot looks like:
I tried setting the dimensions and getting them at different points of the test to see if they were working. The only difference was that I got more white before the actual screenshot.
Now, I had had a similar issue in the past with this same computer but I fixed it by giving fix dimensions to the screen. The only difference from when I tested then is that I didn't have a second screen set up at the time.
I tested the project on some friends' computers and it also worked correctly there too, the screenshots didn't look cut.
At that point I wondered if it was about the differences in our set-ups, which were:
- me without the issue: 2013 13-inch MacBook Pro (working with and without the 32-inch second screen)
- me with the issue: 2017 13-inch MacBook Pro (working with and without the 32-inch second screen)
- first friend (no issue): 13-inch 2019 MacBook Pro, 27-inch screen with mirror displays arrangement
- second friend (no issue): 16-inch MacBook Pro and working with a 32-inch second screen.
I thought that it could be the mirror displays arrangement and when I did it on the computer where I had the issue, the screenshots look alright again.
However, I still don't know understand why (since my second friend was not using the mirror displays arrangement) and what's more important, how do I avoid it in the future where I probably won't have power over the setup where my project is run?
Can anyone help me? I have not found any information about this issue anywhere.
Thank you in advance and please do let me know if you need more (or less) information.
Thank you in advance!