We have an open bug in our Automation Testing Framework regarding the resizing limitations of a Chrome Window when it is controlled by Selenium + ChromeDriver and I need help since I can’t track down an official answer. As far as I am aware this was not an issue in the past.
We currently use the framework Codeception as the base for our own framework and when we use the action resizeWindow
with the dimensions 320x568
it resizes the window to 445x500
. Has anyone else ran into this issue with Chrome? It looks like a hardcoded limit at this point. Any advice would be greatly appreciated. Below I’ve provided a few Tests that I’ve ran looking for the upper and lower limits of the resizing action.
Test #1
- Requested Size: 320×568
- Resulting Size: 445×500
Test #2
- Requested Size: 5000×5000
- Resulting Size: 858×5000
Test 3
- Requested Size: 1×1
- Resulting Size: 252×500
LINKS
3
Answers
I found an answer to my question in another StackOverflow question.
"Chrome cannot resize horizontally below 400px (OS X) or 218px (Windows)"
Browser doesn't scale below 400px?
Can you please try with selenium dimension import
Import : import org.openqa.selenium.Dimension;
code :
Try using firefox. It works great. since chrome’s setting changed and it won’t work for testing media queries unless you use the dev tools.