How to maximize or minimize a browser window using Selenium webdriver with Python

0 votes
How to maximize or minimize a browser window using Selenium webdriver with Python?
Jul 31, 2019 in Selenium by Pooja
21,455 views

2 answers to this question.

0 votes

Hey Pooja, you can use following commands to maximize or minimize a browser window using Selenium Webdriver:

driver = webdriver.Chrome()
driver.maximize_window()
driver.minimize_window()
answered Jul 31, 2019 by Baldev
sometime a little help can solve a big problem ..thanks ...

I was in the middle of a problem .. Searching solution for  4-5 hours .. thanks
+1 vote
from selenium import webdriver

# get initial window size
driver = webdriver.Firefox()
print driver.get_window_size()

# set window size
driver.set_window_size(480, 320)
print driver.get_window_size()

# maximize window
driver.maximize_window()
print driver.get_window_size()
answered Apr 1, 2020 by Rajavenkatesh
returns same result
Hey, did this work for you? what result are you getting?

Related Questions In Selenium

0 votes
2 answers

How to open a browser window in full screen using Selenium WebDriver with C#

Hi , we have inbuilt method Maximize(). driver.Manage().Wind ...READ MORE

answered Sep 5, 2020 in Selenium by Sri
• 3,010 points
11,665 views
0 votes
1 answer

How to minimize a browser window using Selenium Webdriver?

Hello Kashmira, to minimize a browser window ...READ MORE

answered Jul 15, 2019 in Selenium by Anvi
• 14,150 points
1,890 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

How to launch browsers using Python-Selenium?

Hey Nikita, to launch browser in Python-Selenium, ...READ MORE

answered May 24, 2019 in Selenium by Anvi
• 14,150 points
205 views
0 votes
1 answer

How to Hover using Mouse in python using Webdriver

from selenium.webdriver.common.action_chains import ActionChains def hover(self): ...READ MORE

answered Aug 8, 2018 in Selenium by Meci Matt
• 9,460 points
1,452 views