Chrome window not maximized

2,291 views
Skip to first unread message

Muthu Selvan

unread,
Nov 21, 2014, 2:34:06 AM11/21/14
to nightw...@googlegroups.com

Hi , 

I have implemented parallel execution of chrome and firefox .

firefox opened in maximized state but chrome is not opened in maximixed mode .

I am using the below configuration and its not disabled the security alrert , please help me for my issue .  

 "desiredCapabilities" : {
        "browserName" : "chrome",
        "javascriptEnabled" : true,
        "acceptSslCerts" : true ,
        "chromeOptions": {
           "args": ["window-size=1880,800", "disable-web-security"]
        }
      }

Thanks ,
Muthu Selvan SR 

Andrei Rusu

unread,
Nov 21, 2014, 4:23:02 AM11/21/14
to nightw...@googlegroups.com
Try passing "start-maximized" to the args array of chromeOptions.
> --
> You received this message because you are subscribed to the Google Groups
> "NightwatchJs" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to nightwatchjs...@googlegroups.com.
> To post to this group, send email to nightw...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/nightwatchjs/faa01a5a-166b-4de1-b493-af68f4d934bd%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Lacy Morrow

unread,
Nov 21, 2014, 1:58:40 PM11/21/14
to nightw...@googlegroups.com
Also, if you want all the browsers running a test to be maximized, you can use the command:

browser.maximizeWindow()

Muthu Selvan

unread,
Nov 21, 2014, 6:14:05 PM11/21/14
to nightw...@googlegroups.com
Thanks Andrei for you replay , i have changed as you said in below but still its NOT maxmized , please advice what is wrong ?

  "desiredCapabilities" : {
        "browserName" : "chrome",
        "javascriptEnabled" : true,
        "acceptSslCerts" : true ,
        "chromeOptions": {
           "args": ["window-size=1880,800", "disable-web-security","start-maximized"]
        }
      }
    },


On Friday, November 21, 2014 1:23:02 AM UTC-8, Andrei Rusu wrote:

Muthu Selvan

unread,
Nov 21, 2014, 6:15:21 PM11/21/14
to nightw...@googlegroups.com
Lacy ,

I am new to nightwatch could you please let me know where i need to pass the command and How ?

Thanks ,
Muthu Selvan SR 

Muthu Selvan

unread,
Nov 21, 2014, 6:19:22 PM11/21/14
to nightw...@googlegroups.com
Andrei ,

its working with the below setting but browser is not coming in front its side back side of the terminal window 

"desiredCapabilities" : {
        "browserName" : "chrome",
        "javascriptEnabled" : true,
        "acceptSslCerts" : true ,
        "chromeOptions": {
           "args": ["disable-web-security","start-maximized"]
        }
      }
    },

Lacy Morrow

unread,
Nov 21, 2014, 7:51:56 PM11/21/14
to nightw...@googlegroups.com
Hi Muthu,
Just place that command anywhere in your test just like every other nightwatch command (click, setValue, assert, etc.)

ex:
browser
 
.url('http://google.com/')
 
.maximizeWindow()
 
.click('#button')


Andrei Rusu

unread,
Nov 22, 2014, 4:41:06 AM11/22/14
to nightw...@googlegroups.com
yeah I noticed that too. It must be a chromedriver issue. Which OS are you on?

Muthu Selvan

unread,
Nov 24, 2014, 5:36:07 PM11/24/14
to nightw...@googlegroups.com
Andrei , 

Thanks for sharing the info , i am using mac OS .

Chrome window will not maximized in mac OS ? confirm please ?


Regards ,
Muthu Selvan SR 

Andrei Rusu

unread,
Nov 24, 2014, 5:50:37 PM11/24/14
to nightw...@googlegroups.com
My problem is that the window is not focused. I haven't gotten to the
bottom of it yet.
> https://groups.google.com/d/msgid/nightwatchjs/489061c3-6af6-4abf-a0a0-64e13b68d819%40googlegroups.com.

Muthu Selvan

unread,
Nov 24, 2014, 7:12:33 PM11/24/14
to nightw...@googlegroups.com
Andrei ,

My problem also same , the chrome window is not focused when running the script ? 

is it any thing bug in nightwatch or should i need to change in nighwatch.json ? advice please 

Thanks 
Muthu Selvan SR 

Adam Wardecki

unread,
Sep 8, 2015, 6:03:51 AM9/8/15
to NightwatchJs
Old post but for future reference. Looks like it's a chromedriver issue: https://code.google.com/p/chromedriver/issues/detail?id=985
You could use "start-fullscreen" as a workaround:

      "desiredCapabilities": {
        "browserName": "chrome",
        "javascriptEnabled": true,
        "acceptSslCerts": true,
        "chromeOptions" : {
         "args" : ["start-fullscreen"]

Piotr Sobczyk

unread,
Dec 3, 2015, 9:37:21 AM12/3/15
to NightwatchJs
Have anybody found a way to bring Chrome window to the front without using "start-fullscreen" arg? (the fullscreen behaviour on the new OS X systems is really irritating and it's making my testing process less effective).
Reply all
Reply to author
Forward
0 new messages