Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Selenium FirefoxOptions - how to set browser window to be maximised at start?

I''m building some Jave/Junit Selenium tests to work with both Chrome and Firefox.

I can't find any info on how to start the Firefox browser window in a maximised state. With Chrome I can use ChromeOptions, like:

anOptions.addArguments("--start-maximized");

I can't find any way to make the same thing happen for Firefox and FirefoxOptions.

Any suggestions?

like image 404
user2868835 Avatar asked Mar 01 '18 11:03

user2868835


1 Answers

For python with Firefoxyou can use:

driver = Firefox()
driver.maximize_window()
like image 80
Pedro Lobito Avatar answered Oct 02 '22 03:10

Pedro Lobito