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!
To maximize browser in Selenium, you need to call the maximize() Selenium command to maximize window interface of the driver class. void maximize() – This method is used to maximize the current browser.
We can maximize or minimize a browser window using Selenium webdriver in Python. We can use the method maxmize_window to maximize a browser. We can use the method minimize_window to minimize a browser. Finally, Again, to get the size of the browser, we can use the method get_window_size.
You could use ChromeOptions and set suitable argument:
options = ChromeOptions() options.add_argument("--start-maximized") driver = ChromeDriver(options)
Nothing worked for me except:
driver.set_window_size(1024, 600) driver.maximize_window()
I found this by inspecting selenium/webdriver/remote/webdriver.py. I've never found any useful documentation, but reading the code has been marginally effective.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With