Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Webdriver - open browser on full screen

I use Webdriver remotely with firefox.

I want to open my browser on full screen. The browser is opened on full screen, but immediately minimize and moves to other program which open on my OS. When I run my webdriver locally, the broser is opened on full screen, and doesn't minimize (it stays in the browser, and doesn't move to other program). I want that my browser would open on full screen, and stay in the browser, even if I run my test remottley.

The reason is that I used Java Robot, and I have to be in the browser in order that my action would be performed.

Thank you.

like image 437
Adam Sh Avatar asked Feb 19 '13 06:02

Adam Sh


People also ask

How do I open Selenium browser full screen?

We can open a browser window in full screen using Selenium webdriver in C# by using the method Maximize. This method has to be applied on the webdriver object.

How do I make Chrome full screen in Selenium?

Use --start-fullscreen argument to Specify the browser should start in fullscreen mode, like if the user had pressed F11 right after startup. ChromeOptions options = new ChromeOptions(); options. addArguments("--start-fullscreen"); WebDriver driver = new ChromeDriver(options);


2 Answers

In Python, you can do something like this. Make sure you use latest Selenium package.

 driver = webdriver.Firefox()
 driver.maximize_window()
 driver.implicitly_wait(30)
like image 113
Hassan Muneer Avatar answered Oct 31 '22 21:10

Hassan Muneer


I don't know I really understood your question, but have a look at

driver.manage().window().maximize();
like image 45
Stéphane Piette Avatar answered Oct 31 '22 21:10

Stéphane Piette