Explore Courses Blog Tutorials Interview Questions
0 votes
in DevOps and Agile by (19.7k points)

Is there a way to maximize the chrome browser window using python selenium WebDriver?

Note: I am using Chrome Driver 23.0 Any solution on this would be greatly appreciated!

1 Answer

0 votes
by (62.9k points)

 I will tell you how to maximize a browser window using a web driver. Here is a Selenium script with an explanation.

Script Description: In the below Selenium script shown the maximize of the browser using the testNG framework, steps of the scenario are :

  1. Open the Chrome browser.
  2. Launch the site.
  3. Wait for a few seconds to view the maximize action.
  4. Close the browser.

import org.openqa.selenium.WebDriver;


public class Maximize {

public static void main(String args[]) throws InterruptedException

{ WebDriver driver;


driver= new ChromeDriver();

         // Launch the application


          //Resize current window to the set dimension


            //To Delay execution for 10 sec. as to view the maximize browser


              //Close the browser




The Output Analysis is as follows:

It automatically opens the chrome browser, maximizes the browser, waits for a few seconds and closes the browser. 

Browse Categories