Maximize The Browser Window Using Protractor

Maximize The Browser Window Using Protractor

Protractor is browser automation and end-to-end testing framework built on-top of JavaScript Selenium webdriver for testing Angular based applications. It tests your applications like a real user by running your tests using the real web browsers.

In this post, we’re going to learn to maximize the browser window while running the automation tests.

Protractor comes bundled with feature which allows you to do the same


To maximize your window all you need to do is use above code inside your tests.

describe('testing super calc using protractor', function() {
  it('should maximize the web browser window', function() {

If you wish to run all your tests in maximized window, you can take advantage of onPrepare method inside your configuration file.

exports.config = {
  seleniumAddress: 'http://localhost:4444/wd/hub',
  specs: ['*.spec.js'],
  onPrepare: function() {

And that’s it! In case if you’ve any query or feedback feel free to drop a comment.

Recommended: How to Run Protractor Test Cases in Firefox Browser

Leave a Reply

Your email address will not be published. Required fields are marked *