How to increase the screen resolution for VMWare/vSphere virtual machines for running Selenium tests? - selenium-chromedriver

While running Selenium tests using the Chrome driver on a virtual machine created in vSphere/VMware, the window size seems to be limited. Our tests try to set the window size to 1920x1080, which results in the following log messages:
2019-11-04 10:14:55.1255 WARN Reloading WebDriver.
2019-11-04 10:14:55.1385 TRACE Choosed browser from config: Chrome
2019-11-04 10:14:59.8548 TRACE Window.Size: 1004 width and 748 height. Size is changing
2019-11-04 10:15:00.0728 TRACE Webdriver browser name: chrome
2019-11-04 10:15:00.0768 TRACE Webdriver browser version: 77.0.3865.120
2019-11-04 10:15:00.0768 TRACE Platform : Any
2019-11-04 10:15:00.0768 TRACE Browser size: {Width=1044, Height=788}
2019-11-04 10:15:00.0918 WARN WebDriver reloaded.
As you can see the window size is increased slightly but not to the configured size. Configuring a lower window size, like 800x600, results in the following log messages:
2019-11-04 10:14:55.1255 WARN Reloading WebDriver.
2019-11-04 10:14:55.1385 TRACE Choosed browser from config: Chrome
2019-11-04 10:14:59.8548 TRACE Window.Size: 1004 width and 748 height. Size is changing
2019-11-04 10:15:00.0728 TRACE Webdriver browser name: chrome
2019-11-04 10:15:00.0768 TRACE Webdriver browser version: 77.0.3865.120
2019-11-04 10:15:00.0768 TRACE Platform : Any
2019-11-04 10:15:00.0768 TRACE Browser size: {Width=800, Height=600}
2019-11-04 10:15:00.0918 WARN WebDriver reloaded.
So, in this case the window size was updated successfully. So it seems like the window size is limited in some way, likely by the screen resolution of the VM.
We've updated the VMware tools on the machine and we also increased the video memory of the machine from 8 to 16 MB. Both of these attempts resulted in the same behaviour.
So, the question is: does anyone know how we can increase the screen resolution of the VM (e.g. in the vSphere web client) so our Selenium tests can run with a window size of 1920x1080?

Related

Getting unknown error: Original error: chrome not reachable when running multiple test scenarios with Appium

I am getting the following error while running more than two tests in a single sessions. I am running tests on Appium connecting to a Android device with launching the latest chrome driver. I have tried multiple Chrome Drivers and multiple android devices. I have installed the chrome and adnroid packages via npm.
Set up
Test running on chrome and not native app
Navigating to website and locating elements
Webdriver.io is used as the language
All test passes individually and when running collectively the chrome browser closes unexpectedly
Error
unknown error: An unknown server-side error occurred while processing the command. Original error: chrome not reachable
Following
(Session info: chrome=99.0.4844.88) at getErrorFromResponseBody (node_modules/webdriver/build/utils.js:197:12) at NodeJSRequest._request (node_modules/webdriver/build/request/index.js:158:60) at processTicksAndRejections (internal/process/task_queues.js:93:5) at Browser.wrapCommandFn (node_modules/#wdio/utils/build/shim.js:137:29) at Browser.wrapCommandFn (node_modules/#wdio/utils/build/shim.js:137:29) at Browser.custom$ (node_modules/webdriverio/build/commands/browser/custom$.js:33:15) at Browser.wrapCommandFn (node_modules/#wdio/utils/build/shim.js:137:29) at clickElementByTestID (common/utilityFunctions.js:22:19) at clickButton (common/utilityFunctions.js:10:3) at Context.<anonymous> (regression/playerPage.test.js:83:7)
Appium logs
"sessionId":"950ead8ecfe328a1e21730262ab7bcba","status":100,"value":{"message":"chrome not reachable\n (Session info: chrome=74.0.3729.185)\n (Driver info: chromedriver=74.0.3729.6 (255758eccf3d244491b8a1317aa76e1ce10d57e9-refs/branch-heads/3729#{#29}),platform=Mac OS X 10.16.0 x86_64)"}}
[MJSONWP] Matched JSONWP error code 100 to UnknownError
[HTTP] <-- POST /wd/hub/session/6cc6fac2-f706-4d91-b577-3986c10da540/cookie 500 27 ms - 1157
Capabilities
const androidWebCaps = {
platformName: 'Android',
automationName: 'UiAutomator2',
deviceName: process.env.ANDROID_DEVICE_NAME || 'Pixel 4 XL',
platformVersion: process.env.ANDROID_PLATFORM_VERSION || '10.0',
auto_accept_alerts: 'true',
appActivity: process.env.APP_ACTIVITY || "com.google.android.apps.chrome.Main",
browserName: 'Chrome'
};
I have tried the following:
different versions of Chrome driver
Different Android devices
each test passes individually

Protractor Test cases execution fails when try to run on Headless Chrome V71

I'm using protractor for my e2e tests.
Recently we updated to Chrome 71 and Webdriver 2.45 and now we constantly
get the error: "chrome not reachable" when running headless.
If we do not run headless our tests pass. Because headless tests are more consistent en faster I still want to use headless mode.
On chrome 70 and webdriver 2.44 we had no problems at all.
args: [
'--disable-gpu',
'--disable-impl-side-painting',
'--disable-gpu-sandbox',
'--disable-accelerated-2d-canvas',
'--disable-accelerated-jpeg-decoding',
'--disable-popup-blocking',
'--no-sandbox',
'--test-type=ui',
'--start-maximized',
'--window-size=1800,1000',
'--headless'
]
WebDriverError: chrome not reachable
(Session info: headless chrome=71.0.3578.80)
(Driver info: chromedriver=2.45.615355 (d5698f682d8b2742017df6c81e0bd8e6a3063189),platform=Mac OS X 10.14.1 x86_64)
Any thoughts?
The cause in our case is most likely to be this bug in either ChromeDriver or Chrome headless:
Unable to download a file when using in headless mode (selenium, chromedriver)
Some of our tests trigger file downloads, and it appears that ChromeDriver or Chrome headless freezes from that point onward, responding to any further requests with "chrome not reachable".

My robot framework test does not work with chrome

I have written some test suites with robot framework using RIDE. As browser I have used Firefox and all test passed without any problem. But I have now to use Chrome as reference browser. But chrome isn't working. So I have done a very simple test case:
Open Browser http://google.com ${BROWSER}
If I enter "ff" as my ${BROWSER} variable I get a Firefox window with the google website displayed within it.
When I change the ${BROWSER} variable to chrome, I get a browser window which is black.
I get the following error in the log file:
WebDriverException: Message: session not created exception
from timeout: Timed out receiving message from renderer: 600.000
(Session info: chrome=55.0.2883.87)
(Driver info: chromedriver=2.27.440174 (e97a722caafc2d3a8b807ee115bfb307f7d2cfd9),platform=Windows NT 6.1.7601 SP1 x86_64)
My configuration is:
Robot Framework 3.0
RIDE 1.5.2.1
Selenium2Library 1.7.4
Python 2.7.12
wx 2.8.12.1
Google Chrome 55
Chromedriver 2.27

react-native Chrome debug from device is broken? ( Runtime not ready for debugging )

Can anyone suggest things to check for that break Chrome debug on a device? Chrome debug works fine debugging an iOS simulator.
Chrome debug of iOS devices had been working fine for over a month until it stopped working a week or so ago.
I have spent days trying to get Chrome debug working again. I even started all over, with a new "AwesomeProject". No luck.
Does Chrome Debug URL stay same for debugging both device and simulators?
http://localhost:8081/debugger-ui
Using OS X 10.11.3, Xcode 7.3, iOS 9.3, and react-native 0.22
MacBook WiFi: 173.17.29.213
iPad WiFi: 173.17.29.77
I can ping iPad from MacBook.
I can run AwesomeProject on iPad and enable live reload.
I can debug fine in a simulator when jsCodeLocation set to localhost
I killed Chrome and restarted it, opened http://localhost:8081/debugger-ui
React Packager is running
I can set Xcode breakpoints
File: AppDelegate.m
jsCodeLocation = [NSURL URLWithString:#"http://173.17.29.213:8081/index.ios.bundle?platform=ios&dev=true"];
Xcode debug console displays:
2016-03-31 08:02:12.286 [error][tid:com.facebook.react.RCTBridgeQueue][RCTWebSocketExecutor.m:85] Runtime is not ready for debugging.
- Make sure Packager server is running.
- Make sure Chrome is running and not paused on a breakpoint or exception and try reloading again.
2016-03-31 08:02:12.319 [error][tid:main][RCTWebSocketExecutor.m:132] WebSocket connection failed with error Error Domain=NSPOSIXErrorDomain Code=61 "Connection refused"
2016-03-31 08:02:12.513 [fatal][tid:main] Runtime is not ready for debugging. Make sure Packager server is running.
2016-03-31 08:02:36.032 [error][tid:main][RCTWebSocketExecutor.m:132] WebSocket connection failed with error Error Domain=NSPOSIXErrorDomain Code=61 "Connection refused"
2016-03-31 08:02:36.032 [error][tid:com.facebook.react.RCTBridgeQueue][RCTWebSocketExecutor.m:85] Runtime is not ready for debugging.
- Make sure Packager server is running.
- Make sure Chrome is running and not paused on a breakpoint or exception and try reloading again.
2016-03-31 08:02:36.707 [fatal][tid:main] Runtime is not ready for debugging. Make sure Packager server is running.
File: package.json
{
"name": "AwesomeProject",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start"
},
"dependencies": {
"react": "^0.14.8",
"react-native": "^0.22.2"
}
}
You're close, one more step and works for me at the moment after facing exact situation:
"To debug on a real device:
On iOS - open the file RCTWebSocketExecutor.m and change localhost to the IP address of your computer. Shake the device to open the development menu with the option to start debugging. [1]"
[1] https://facebook.github.io/react-native/docs/debugging.html

karma + Chrome not working after last auto-update of Chrome

We use jenkins with a number of jenkins slave nodes running on Windows 7. Through jenkins we kick off karma tests to be run on the slave node to run our jasmine tests on the actual browsers. Suddenly last week after Chrome auto-updated to version "38.0.2125.104 m" this stopped working (karma unable to capture the browser). Here are our logs:
[INFO] --- maven-karma-plugin:1.8:start (default-cli) # module-translation ---
[INFO] Executing Karma Test Suite ...
[INFO] cmd /C karma start C:\dev\util\jenkinsMaster\workspace\ci_module_translation_browser\translation\target\test-classes\frontend\thirdParty\js\com\verisk\underwriting\config\karma-config-module\1.0.3\karma-config-module-1.0.3.js --browsers Chrome --single-run
INFO [karma]: Karma v0.12.5 server started at http://localhost:9876/
INFO [launcher]: Starting browser Chrome
WARN [launcher]: Chrome have not captured in 60000 ms, killing.
INFO [launcher]: Trying to start Chrome again (1/2).
WARN [launcher]: Chrome have not captured in 60000 ms, killing.
INFO [launcher]: Trying to start Chrome again (2/2).
WARN [launcher]: Chrome have not captured in 60000 ms, killing.
ERROR [launcher]: Chrome failed 2 times (timeout). Giving up.
When running locally, the same command (using the karma-maven-plugin) works just fine. The karma plugin just runs the karma executable installed separately (which also works when run locally). Additionally, other browsers work when kicked off from jenkins. They have been working for quite some time now, along with Chrome (until this last update from Chrome). It is only the combination of the three: jenkins + karma + Chrome that is resulting in this issue.
Since Chrome has made it as hard as possible to get an older version, this has been very hard to test or resolve. Everything seems to be pointing to the current version of Chrome as the culprit.
Has anyone else seen this or have a solution?
The fix has been merged into Chromium. The fix is now available through a regular update of Chrome. This works for version Chrome 39.0.2171.