TestCafe Update "local" Chrome in Jenkins - google-chrome

I am running tests in Jenkins and the tests are running on outdated Chrome 71 and I want to update the chrome it is using. I've tried updating my package.json to current TestCafe but it is still running 71. when I run node_modules/.bin/testcafe --version it just lists firefox, chrome. It seems that since the chrome is in node_modules I should be able to update to latest but I haven't found anything online to show how to do so.
Running locally on my machine chrome is v91. I thought doing an 'npm i' locally and pushing that branch would update but it was not successful.
Jenkins output:
npm i
node_modules/.bin/testcafe --version
1.15.0
node_modules/.bin/testcafe -e chrome:headless auth-subscriber-signs-in-validates-homepage.js
Running tests in: Chrome 71.0.3578.98 / Linux 0.0

TestCafe doesn't upgrade or downgrade browsers. It just searches the installed browsers and runs tests in them. You need to inspect the Jenkins job and found the way how browsers are installed for it.

Related

Unable to use correct ChromeDriver version

I am conducting QA automation testing. The code was running and working fine last week, but on restarting my computer over the weekend, it has stopped working with this error message:
Request failed with status 500 due to session not created:
This version of ChromeDriver only supports Chrome version 103
I assume it auto-updated Chrome when I restarted the laptop, as it's gone from version 103 to 105, which means I need to update my ChromeDriver.
I've done this before a few months ago, can't totally remember the steps I followed but I got it working. I possibly did something wrong then, as I can't seem to update ChromeDriver from 103 to 105.
I've tried to remove my current instance and reinstall the newer version by running:
npm uninstall chromedriver -g
npm install -g chromedriver --detect_chromedriver_version --scripts-prepend-node-path
Also tried the same having downloaded it from here:
https://chromedriver.storage.googleapis.com/index.html?path=105.0.5195.52/
and doing
npm install -g chromedriver --chromedriver_filepath=<PATH>
Also tried removing chromedriver from my package.json, doing an npm install, then adding it back in and doing an npm install. Each of these methods say they have installed the correct chromeDriver version (105.0.5195.52)
My package.json currently shows:
"dependencies": {
"chromedriver": "^105.0.0",
},
and when I do chromeDriver -v I see:
ChromeDriver 105.0.5195.52
Any ideas? If additional information is required please let me know. I know I could probably get around this by downgrading my Chrome version to 103, but I'd prefer to avoid that if possible.
On further investigation, I think it's something to do with selenium. Running my tests on their own works, but if I do selenium-standalone start and then run them, it's failing as above.
I've updated selenium by running:
npm install selenium-standalone#latest -g
npm install
Following that, when I try to start it, it's giving me an error that chromedriver is missing within the selenium node_modules folder.
A bit more investigation and I've found I also needed to run
selenium-standalone install
This did some updating, and then I was able to run
selenium-standalone start
All good now :)

How can I get chromedriver to work properly with chrome in wsl2?

I am trying to run automated tests on a repository forked from here. I haven't really worked with yarn or mocha before (or chromedriver) so I'm going off of what the instructions are saying.
I've set up Ubuntu 18.04 in wsl2 and installed google-chrome-stable and chromedriver both at version 99.0.4844.51 in /usr/bin/. I have yarn start running in one terminal and when I try actually run yarn test it gives me:
SessionNotCreatedError: session not created: This version of ChromeDriver only supports Chrome version 94
Current browser version is 99.0.4844.51 with binary path /usr/bin/google-chrome-stable
I've tried upgrading chromedriver from here to version 100.0.4896.20 but it gives me the same error saying it only supports Chrome version 94. I'm having a hard time trying to find Google version 94 for linux, and I'll be happy either way, either upgrading the chromedriver or downgrading chrome.

Need to run protractor tests with chrome using xvfb in RHEL 7.xx box

I need to run protractor tests with chrome on a headless mode in a remote RHEL 7.xx box. I realize that I need to have xvfb installed on the remote RHEl box and run using xvfb.
Can somebody help me with this installation/configuration if something has really worked for someone.

How can I downgrade to Chrome 42.0.2311.90?

Google Chrome on my machine recently got updated to v44.
I'm working with Selenium WebDriver on Chrome and as soon as I updated Chrome, all my tests went dead. I use Chromedriver v2.16. My partner's PC has Chrome v42.0.2311.90 and Chromedriver v2.16. And tests run fine on his machine. Now, based on this I'm pretty sure the problem is probably not with Chromedriver.
So, how can I downgrade to Chrome 42.0.2311.90?
I've tried using an offline installer from here:
Google Chrome Alternate Offline Installer
But this always gives me the latest version to install i.e. v44.
The release that I need can be found here:
Google Chrome v42.0.2311.90 Stable Channel Update
Uninstall your current chrome version.
Remove all Chrome data for current version from: C:\Users\username\AppData\Local\Google\Chrome
Download your particular version from chrome_installer.
Disable chrome updates using instructions given on this link.
Following steps help you to install your desired google chrome version :
1 - Uninstall your current google chrome version.
2 - Download your desired google chrome version from here : Google Chrome Download
3 - Restart PC once so if any registry or temp file stored of previous google chrome then it will get refresh.
4 - Install your downloaded google chrome. And then turn off automatic chrome update.
I struggled with this same problem on Mac, trying to downgrade, and stay downgraded from Chrome 53 to 52 due to a serious bug affecting webaudio.
None of the other recommendation appear to apply any more (or on Mac OS X at least). The app attempts to upgrade itself and there doesn't be a way to configure that in a "Chrome-friendly" way.
Eventually I resorted to force...
Close and uninstall Chrome
Edit your /etc/hosts file to prevent update checks from working by overriding the DNS entry:
0.0.0.0 tools.google.com
Find and download an old release. This is left as an exercise, this was actually hard and fraught with fear of bad binaries. I was able to cross-reference MD5s from one site that didn't have downloads with another that had downloads.
Install and run the older version
Important: Check the "About" page, and point and laugh at Chrome's attempts to check in.
This is how you can use an older chrome version "in general":
Uninstall your current chrome
Install the chrome version you desire
DO NOT open chrome!! after installation
Instead disable auto-updates like here or here
Only then may you work with your desired chrome browser version
As for how to get a specific older version:
You need to google, search forums or try sites like this. It's just "grunt work" to find the version you are looking for. If you're extremely unlucky, the very version you need might even not be around any more.
If you are running on a windows machine you can leverage the package manager chocolatey, this is how we I'm doing it from Jenkins, we call a powershell that uninstalls a previous version and install a specific one: From a powershell ide script window, you need to have installed the modules for chocolatey that is a small price to pay for a lot of benefit:
choco install googlechrome --version 62.0.3202.94 -y
Then to prevent Chrome to self update I am performing this steps:
1. Verify Chrome's current version.
(Get-Item (Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\chrome.exe').'(Default)').VersionInfo
Install the version I'm aiming for:
choco install googlechrome --version 62.0.3202.94 -y
You can look for available versions here:
https://chocolatey.org/packages/GoogleChrome
(Find Version History Section)
Kill GoogleCrashHandler.exe in any of its variants 32 or 64 bits or both.
Delete the Directories
C:\Program Files (x86)\Google\Update and
C:\Program Files (x86)\Google\CrashReporter
You will loose the ability to auto update (which is the whole purpose right) and
you will loose the ability to send crash reports and piggy back on that executable to update against your will whenever google deems convenient.
5.Disable Chrome Services

Chromedriver failing to launch or connect

Up until today, I have been using chromedriver to drive my watir-webdriver tests, and I have had no problems. My server still works and runs tests on the same version of the chromedriver and chrome.
I have tried updating to the latest chromedriver, which is the chromedriver 2 experimental build. This fails due to what I can only assume are still bugs being worked out of it.
I have also tried rolling back to the previous version of chromedriver with no success.
If anyone has any experience with this, I would really appreciate your expertise. I am sure it will turn out to be something simple I have overlooked.
gem versions:
watir-webdriver (0.6.2)
selenium-webdriver (2.29.0)
cucumber (1.2.1)
trace from the chromedriver below
Started ChromeDriver port=9517 version=26.0.1383.0
log=C:\Projects\oms_acceptance_tests\src\chromedriver.log
[6136:5300:0212/122320:ERROR:master_preferences.cc(110)] Failed to read master_preferences file at C:\Program Files (x86)\Google\Chrome\Application\master_preferences. Falling back to default preferences.
[6136:5300:0212/122320:ERROR:gpu_info_collector_win.cc(82)] Can't retrieve a valid WinSAT assessment.
test\automation\proxy_launcher.cc(107): error: Value of: app_launched
Actual: 5
Expected: AUTOMATION_SUCCESS
Which is: 0
Error while awaiting automation ping from browser process
[0212/122321:ERROR:proxy_launcher.cc(556)] Failed to ConnectToRunningBrowser
[0212/122321:ERROR:automation_proxy.cc(319)] Channel error in AutomationProxy.
Unable to either launch or connect to Chrome. Please check that ChromeDriver is up-to-date. Using Chrome binary at: C:\Program Files (x86)\Google\Chrome\Application\chrome.exe (Selenium::WebDriver::Error::UnknownError)
I would trying downloading newer version of chromedriver. Worked for me when I experienced similar issues.
To get rid of the gpu winsat error, try to update your display adapter.