nightwatchjs / nightwatch

Integrated end-to-end testing framework written in Node.js and using W3C Webdriver API. Developed at @browserstack
https://nightwatchjs.org
MIT License
11.83k stars 1.32k forks source link

ResizeWindow not working in Chrome #1706

Closed citypaul closed 6 years ago

citypaul commented 6 years ago

Neither resizeWindow() or windowSize() appear to work in the latest version of Chrome on MAC OS.

Versions used:

Chrome: Version 63.0.3239.132 (Official Build) (64-bit) MacOS Sierra: 10.12.6 (16G29) Selenium standalone: 3.4.0 Nightwatch: 0.9.19 Node: 8.1.0

Example test:

module.exports = {
  'my test': browser => {
    browser
      .url('bbc.co.uk/sport')
      .resizeWindow(400, 400)
      .waitForElementVisible('body', wait)
      .assert.elementPresent('body')
      .end();
  }
};

The window is just not resizing under any condition. It does appear to work in Firefox, but not in Chrome.

Full selenium dump:

Last login: Tue Jan 23 15:58:05 on ttys004
sle%                                                                                                                              λ localhost live-nightwatch-e2e → λ git master* → selenium-standalone start
15:58:47.820 INFO - Selenium build info: version: '3.4.0', revision: 'unknown'
15:58:47.821 INFO - Launching a standalone Selenium Server
2018-01-23 15:58:47.860:INFO::main: Logging initialized @534ms to org.seleniumhq.jetty9.util.log.StdErrLog
15:58:47.949 INFO - Driver provider org.openqa.selenium.ie.InternetExplorerDriver registration is skipped:
 registration capabilities Capabilities [{ensureCleanSession=true, browserName=internet explorer, version=, platform=WINDOWS}] does not match the current platform MAC
15:58:47.949 INFO - Driver provider org.openqa.selenium.edge.EdgeDriver registration is skipped:
 registration capabilities Capabilities [{browserName=MicrosoftEdge, version=, platform=WINDOWS}] does not match the current platform MAC
15:58:47.949 INFO - Driver class not found: com.opera.core.systems.OperaDriver
15:58:47.949 INFO - Driver provider com.opera.core.systems.OperaDriver registration is skipped:
Unable to create new instances on this machine.
15:58:47.950 INFO - Driver class not found: com.opera.core.systems.OperaDriver
15:58:47.950 INFO - Driver provider com.opera.core.systems.OperaDriver is not registered
2018-01-23 15:58:48.045:INFO:osjs.Server:main: jetty-9.4.3.v20170317
2018-01-23 15:58:48.108:INFO:osjsh.ContextHandler:main: Started o.s.j.s.ServletContextHandler@68c4039c{/,null,AVAILABLE}
2018-01-23 15:58:48.166:INFO:osjs.AbstractConnector:main: Started ServerConnector@14bf9759{HTTP/1.1,[http/1.1]}{0.0.0.0:4444}
2018-01-23 15:58:48.166:INFO:osjs.Server:main: Started @840ms
15:58:48.166 INFO - Selenium Server is up and running
15:58:48.386 INFO - SessionCleaner initialized with insideBrowserTimeout 0 and clientGoneTimeout 1800000 polling every 180000
Selenium started
15:58:51.878 INFO - Executing: [new session: Capabilities [{acceptSslCerts=true, name=End To End / Pages / Bodypositive / Video Loads On Page, browserName=chrome, javascriptEnabled=true, chromeOptions={args=[--incognito]}, platform=ANY}]])
15:58:51.913 INFO - Creating a new session for Capabilities [{acceptSslCerts=true, name=End To End / Pages / Bodypositive / Video Loads On Page, browserName=chrome, javascriptEnabled=true, chromeOptions={args=[--incognito]}, platform=ANY}]
Starting ChromeDriver 2.30.477690 (c53f4ad87510ee97b5c3425a14c0e79780cdf262) on port 27117
Only local connections are allowed.
15:58:57.635 INFO - Detected dialect: OSS
15:58:57.662 INFO - Done: [new session: Capabilities [{acceptSslCerts=true, name=End To End / Pages / Bodypositive / Video Loads On Page, browserName=chrome, javascriptEnabled=true, chromeOptions={args=[--incognito]}, platform=ANY}]]
15:58:57.744 INFO - Executing: [get: http://www.bbc.co.uk/sport/bodypositive/36459654])
15:59:03.853 INFO - Done: [get: http://www.bbc.co.uk/sport/bodypositive/36459654]
15:59:03.861 INFO - Executing: [set window size])
15:59:03.888 WARN - Exception thrown
org.openqa.selenium.WebDriverException: disconnected: unable to connect to renderer
  (Session info: chrome=63.0.3239.132)
  (Driver info: chromedriver=2.30.477690 (c53f4ad87510ee97b5c3425a14c0e79780cdf262),platform=Mac OS X 10.12.6 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 11 milliseconds
Build info: version: '3.4.0', revision: 'unknown', time: 'unknown'
System info: host: 'localhost', ip: 'fe80:0:0:0:1:364f:8b05:7a3d%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.12.6', java.version: '1.8.0_131'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{applicationCacheEnabled=false, rotatable=false, mobileEmulationEnabled=false, networkConnectionEnabled=false, chrome={chromedriverVersion=2.30.477690 (c53f4ad87510ee97b5c3425a14c0e79780cdf262), userDataDir=/var/folders/tn/2yk6xwbd6lj_mj6t9tcvfm5n_mbt8v/T/.org.chromium.Chromium.cYoTE8}, takesHeapSnapshot=true, pageLoadStrategy=normal, databaseEnabled=false, handlesAlerts=true, hasTouchScreen=false, version=63.0.3239.132, platform=MAC, browserConnectionEnabled=false, nativeEvents=true, acceptSslCerts=true, locationContextEnabled=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true, unexpectedAlertBehaviour=}]
Session ID: 77574e151ccd3fce97e7c94d62778a19
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:215)
    at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:167)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:671)
    at org.openqa.selenium.remote.RemoteWebDriver$RemoteWebDriverOptions$RemoteWindow.setSize(RemoteWebDriver.java:890)
    at org.openqa.selenium.support.events.EventFiringWebDriver$EventFiringWindow.setSize(EventFiringWebDriver.java:625)
    at org.openqa.selenium.remote.server.handler.SetWindowSize.call(SetWindowSize.java:53)
    at org.openqa.selenium.remote.server.handler.SetWindowSize.call(SetWindowSize.java:27)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at org.openqa.selenium.remote.server.DefaultSession$1.run(DefaultSession.java:176)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:748)
15:59:03.892 WARN - Exception: disconnected: unable to connect to renderer
  (Session info: chrome=63.0.3239.132)
  (Driver info: chromedriver=2.30.477690 (c53f4ad87510ee97b5c3425a14c0e79780cdf262),platform=Mac OS X 10.12.6 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 11 milliseconds
Build info: version: '3.4.0', revision: 'unknown', time: 'unknown'
System info: host: 'localhost', ip: 'fe80:0:0:0:1:364f:8b05:7a3d%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.12.6', java.version: '1.8.0_131'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{applicationCacheEnabled=false, rotatable=false, mobileEmulationEnabled=false, networkConnectionEnabled=false, chrome={chromedriverVersion=2.30.477690 (c53f4ad87510ee97b5c3425a14c0e79780cdf262), userDataDir=/var/folders/tn/2yk6xwbd6lj_mj6t9tcvfm5n_mbt8v/T/.org.chromium.Chromium.cYoTE8}, takesHeapSnapshot=true, pageLoadStrategy=normal, databaseEnabled=false, handlesAlerts=true, hasTouchScreen=false, version=63.0.3239.132, platform=MAC, browserConnectionEnabled=false, nativeEvents=true, acceptSslCerts=true, locationContextEnabled=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true, unexpectedAlertBehaviour=}]
Session ID: 77574e151ccd3fce97e7c94d62778a19
15:59:08.927 INFO - Executing: [find elements: By.cssSelector: body])
15:59:08.986 INFO - Done: [find elements: By.cssSelector: body]
15:59:08.996 INFO - Executing: [is displayed: 0 [[ChromeDriver: chrome on MAC (77574e151ccd3fce97e7c94d62778a19)] -> css selector: body]])
15:59:09.047 INFO - Done: [is displayed: 0 [[ChromeDriver: chrome on MAC (77574e151ccd3fce97e7c94d62778a19)] -> css selector: body]]
15:59:09.057 INFO - Executing: [find elements: By.cssSelector: div#video-collection])
15:59:09.082 INFO - Done: [find elements: By.cssSelector: div#video-collection]
15:59:09.090 INFO - Executing: [delete session: 63313746-4bf3-486c-83dd-6e9d51bcad4b])
15:59:09.219 INFO - Done: [delete session: 63313746-4bf3-486c-83dd-6e9d51bcad4b]
imRohan commented 6 years ago

Same issue on

Ubuntu 16.04.3 LTS Chrome: 63.0.3239.132 Chromedriver: 2.30.1 Nightwatch: 0.9.19 Selenium Server: 3.7.1 Node: 9.4.0

JonWallsten commented 6 years ago

@citypaul @imRohan: If I'm not mistaken this is fixed by updating your chrome driver to version 2.35

imRohan commented 6 years ago

@JonWallsten Updating chromedriver fixed the issue 💃

davidlinse commented 6 years ago

@citypaul Would you mind closing this issue, after confirmation of the suggested solution ? regards

citypaul commented 6 years ago

@davidlinse hi - I've been off work for the past couple of weeks and haven't had the chance to try this yet. I'll confirm with you soon if this is able to be closed after updating Chromedriver, thanks.

citypaul commented 6 years ago

Updating Chromedriver fixes the issue.