Oleg Strokatyy
Oleg Strokatyy

Reputation: 641

Open browser window in full screen using Selenium WebDriver with C#

How can I make browser enter to fullscreen mode? Same as pressing F11.

Upvotes: 8

Views: 40544

Answers (6)

haddagart
haddagart

Reputation: 106

In recent versions you need to access the webdriver directly so it would be,

driver.maximize_window()

P.S This is the python API.

Upvotes: 0

Sohel Shekh
Sohel Shekh

Reputation: 301

For Python, just use

driver.maximize_window()

And it's done!

Upvotes: 7

Erica Joshi
Erica Joshi

Reputation: 31

In selenium/ Python: for maximizing window:

driver.maximize_window()

Upvotes: 3

user2302961
user2302961

Reputation:

driver.Manage().Window.Maximize(); 

isn't that simple?

Upvotes: 24

AJ_Cemprola
AJ_Cemprola

Reputation: 143

Not sure if you know but you can set the size and position of your window as well

webDriver.Manage().Window.Position = new Point(x, y);
webDriver.Manage().Window.Size = new Size(width, height);

Upvotes: 3

AutomatedTester
AutomatedTester

Reputation: 22438

Find the body and then send F11 to that like below.

driver.FindElement(By.TagName("body")).SendKeys(Keys.F11);

Upvotes: 4

Related Questions