In the world of test automation, I often see people asking, “How do I maximise the browser window size?”. I actually used to do this myself in my early days of carrying out TA. Before that, when I worked as a functional tester, I never really thought about this being an issue. Most people have their browser in full screen mode by default, just because it’s more comfortable. But this is a different story when conducting regression tests or using your test automation suite.
And why is this?
The general idea of a regression test
Let’s think about the basics first.
What’s the goal of a regression test? Although this isn’t the complete definition, when it comes down it, the purpose of a regression test is to confirm that something is behaving in exactly the same way as the last time you checked it. The more the execution of your test is different from the last time, the bigger the chance you will find new issues that are not an actual regression.
Help developers to stay happy!
Developers lose a lot of time investigating reported issues. Tickets that are reported during a regression test potentially mean that a new release was bad. So, you want to make sure your issue is actually a regression instead of a mistake that wasn’t caught before your product went live.
Choose a fixed browser size
You should now see that a maximised browser on one machine can have different dimensions on another. Thus, different results could occur if different dimensions are used when testing the same product. It’s the same thing for test automation, where locally you might run a 1080p screen, but the server running your scripts has 720p.
According to W3Schools, the most common screen resolution is 1366×768, so this might be a good place to start. Eventually the resolution you choose doesn’t matter very much, as long as you use the same dimensions on all your desktop tests.
Tools like FireSizer can help you set up fixed sizes. With test automation solutions, you should be able to resize your browser to a fixed size every time it starts.
So next time you Google “How to maximize browser window in Selenium Webdriver”, think about why you would want to do this.
And after thinking about it, don’t do it!