[Chrome Driver] How to open browser in fullscreen?

2,125 views
Skip to first unread message

Szymon Rapacki

unread,
Aug 28, 2013, 8:20:34 AM8/28/13
to seleniu...@googlegroups.com
Hi,

There is any way to open browser in fullscreen mode using Selenium and Chrome Driver? I set --start-maximized switch but it only open browser maximized. I want the behavior like after pressing F11 button.

--
Best Regards
Szymon

Krishnan Mahadevan

unread,
Aug 28, 2013, 3:21:13 PM8/28/13
to seleniu...@googlegroups.com
Can you show us your code and tell us what version of selenium are you working with ?

I recently learnt that using the chrome switches as detailed in the ChromeDriver wiki page doesn't do the trick. You would need to set them via the ChromeOptions class. Are you doing so ?
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/86b0014e-8c9c-4188-997d-7082d6879ec6%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


--
Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/

Szymon Rapacki

unread,
Aug 29, 2013, 4:57:16 AM8/29/13
to seleniu...@googlegroups.com
I use latest version of Selenium 2.35.0
Here is my code:
 
    public void createDriver() {
        options
= new ChromeOptions();
        options
.addArguments("--start-maximized");
        options
.addArguments("--no-sandbox");
        options
.addArguments("--disable-web-security");
        options
.addArguments("--ignore-certificate-errors");
        capabilities
= DesiredCapabilities.chrome();
        capabilities
.setCapability(ChromeOptions.CAPABILITY, options);
        driver
= new RemoteWebDriver(service.getUrl(), capabilities);
   
}

I did workaround and I'm opening fullscreen by Robot class, but in my opinion it should work also by one of switches.

--
Regards
Szymon


W dniu środa, 28 sierpnia 2013 21:21:13 UTC+2 użytkownik Krishnan napisał:
Can you show us your code and tell us what version of selenium are you working with ?

I recently learnt that using the chrome switches as detailed in the ChromeDriver wiki page doesn't do the trick. You would need to set them via the ChromeOptions class. Are you doing so ?

On Wednesday, August 28, 2013, Szymon Rapacki wrote:
Hi,

There is any way to open browser in fullscreen mode using Selenium and Chrome Driver? I set --start-maximized switch but it only open browser maximized. I want the behavior like after pressing F11 button.

--
Best Regards
Szymon

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages