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
35,282 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()

For further understanding, you can refer to the Selenium Training.

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 6, 2020 in Selenium by Sri
• 3,190 points
16,031 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
3,284 views
0 votes
1 answer
0 votes
1 answer

How to Select date from a datepicker with Selenium Webdriver using Python?

Hi Yashim, you can select date from ...READ MORE

answered Jul 31, 2019 in Selenium by Abha
• 28,140 points

edited Oct 7, 2021 by Sarfaraz 10,944 views
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
1,107 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
2,431 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP