ChromeDriver mismatch with Chrome version - unable to get latest version with node module "#wdio/selenium-standalone-service" - selenium-chromedriver

In my codeceptjs setup, I updated #wdio/selenium-standalone-service to latest version 6.9.0
This seem to install chromedriver version version: '85.0.4183.87'
Now that chrome browser version upgraded to 87.0.4280.66, tests that worked fine earlier are now failing with:
Can't connect to WebDriver.
Error: Failed to create session.
session not created: This version of ChromeDriver only supports Chrome version 85
Any suggestion on how this issue can be resolved. Since I am using "#wdio/selenium-standalone-service", did not separately install chromedriver. Hence have this version issue with "#wdio/selenium-standalone-service"

we faced the exact same problem! I managed to get this working by using this version of wdio selenium standalone(5.16.10). I have no idea why it works with this older version though.
“devDependencies”: {
“#wdio/selenium-standalone-service”: “^5.16.10”,
You can specify the latest chromedriver version you want it to use by specifying it in the plugins section.
plugins: {
screenshotOnFail: {enabled: true},
wdio: {enabled: true, services: [‘selenium-standalone’],seleniumArgs: {
drivers: {
chrome: {
version: ‘87.0.4280.20’, // Chromedriver version
arch: process.arch,
},
firefox: {
version: ‘0.26.0’, // Geckodriver version
arch: process.arch,
},
},
},
seleniumInstallArgs: {
baseURL: ‘https://selenium-release.storage.googleapis.com’,
drivers: {
chrome: {
version: ‘87.0.4280.20’,
arch: process.arch,
baseURL: ‘https://chromedriver.storage.googleapis.com’,
},
firefox: {
version: ‘0.26.0’,
arch: process.arch,
baseURL: ‘https://github.com/mozilla/geckodriver/releases/download’,
},
},
}},
allure: {enabled: true},
},

Its a driver mismatch I'm using protractor helper in your case it will webdriver
..../node_modules/protractor/node_modules/webdriver-manager/selenium
so, the solution or you can say its a hack
download the latest chrome driver.
navigate to the respected path mentioned above and copy the chrome driver file name(not the .zip one)
unzip the latest downloaded file here >> delete the existing file and rename the file name which you have copied in the step 2
Now try to run you code

Related

org.openqa.selenium.SessionNotCreatedException: session not created: This version of ChromeDriver only supports Chrome version 111 error with Selenium

I am sure that my tests are working correctly. When I run the code I got the error in terminal like,
Scenario: User adds new quick work order to employee from website # src/test/java/Features/5NewQuickJobOrder.feature:12
Starting ChromeDriver 111.0.5563.19 (378a38865270d286695aeb86f190564911ef7bc2-refs/branch-heads/5563#{#251}) on port 4290
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
org.openqa.selenium.SessionNotCreatedException: session not created: This version of ChromeDriver only supports Chrome version 111
Current browser version is 110.0.5481.97 with binary path C:\Program Files\Google\Chrome\Application\chrome.exe
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'DESKTOP-CONJ3EC', ip: '192.168.1.27', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '19.0.2'
Driver info: driver.version: ChromeDriver
Recently Chrome updates itself and my version is now 110.0.5481.97. But somehow it tries the run the test with version 111 shows below. I have no version in my computer such that starts with 111..
Scenario: User adds new quick work order to employee from website # src/test/java/Features/5NewQuickJobOrder.feature:12
Starting ChromeDriver 111.0.5563.19 (378a38865270d286695aeb86f190564911ef7bc2-refs/branch-heads/5563#{#251}) on port 40758
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
I do not use any chromedriver exe in my project folder, I directly use setup and driver intsance.
public static WebDriver initialize_Driver(String browser) {
properties = ConfigReader.getProperties();
if (browser.equals("Chrome")) {
WebDriverManager.chromedriver().setup();
driver = new ChromeDriver();
}
#Before
public void before() {
String browser = Reporter.getCurrentTestResult().getTestContext().getCurrentXmlTest().getParameter("browser");
properties = ConfigReader.initialize_Properties();
driver = DriverCreater.initialize_Driver(browser);
}
I will be very glad, if you could help me!
First the solution
To instantiate a specific browser version of ChromeDriver you can use:
WebDriverManager.chromedriver().driverVersion("111.0.5563.19").setup();
Details
This error message...
org.openqa.selenium.SessionNotCreatedException: session not created: This version of ChromeDriver only supports Chrome version 111
...implies that SessionNotCreatedException was raised as ChromeDriver was unable to spawn a new Browsing Context i.e. google-chrome session.
Your main issue is the incompatibility between the version of the binaries you are using as follows:
You are using chrome=110.0.5481.97
But you are using chromedriver=111.0.5563.19
Release Notes of chromedriver=111.0 clearly mentions the following :
Supports Chrome version 111
So there is a clear mismatch between chromedriver=111.0 and the chrome=110.0
Solution
Ensure that:
ChromeDriver is downgraded to ChromeDriver v110.0 level.
Chrome Browser is updated to current chrome=110.0 (as per chromedriver=110.0 release notes).
Selenium is upgraded to current released Version 4.8.0.

Protractor won't run chrome

Protractor was running fine but suddenley won't run chrome anymore. This is mye current configuration:
exports.config = {
baseUrl: 'http://localhost:1384/#/',
framework: 'jasmine',
seleniumAddress: 'http://localhost:4444/wd/hub',
specs: ['./tests/e2e/*.js'],
multiCapabilities: [{
//'browserName': 'firefox',
'browserName': 'chrome',
},
],
jasmineNodeOpts: {
showColors: true
}
}
I am running latest of all the related dependencies:
protractor : "protractor": "^5.2.0",
chromedriver: 2.33.506092
webdriver: selenium standalone version available: 3.7.1 [last]
when I run webdriver-manager start eveything runs fine, and then running protractor conf.js gives the following output in the window running the selenium server:
Starting ChromeDriver 2.33.506092 Only local connections are allowed.
The terminal windows running the protractor config, gives the following errros:
E/launcher - WebDriverError: unknown error: Chrome failed to start: exited abnormally
I have already tried reinstalling protractor and updating the chromedriver. Running the tests work fine in firefox with the exact same configurations.
I am also running tests with karma, and karma runs fine in a chrome browser window.
Add directConnect: true to your config file. It might help you.
this would be your conf file
exports.config = {
directConnect: true,
// Capabilities to be passed to the webdriver instance.
capabilities: {
'browserName': 'chrome',
},
// Framework to use. Jasmine is recommended.
framework: 'jasmine',
baseUrl: "YOUR URL",
// Spec patterns are relative to the current working directory when
// protractor is called.
specs: ['../Tests/test.js'],
// Options to be passed to Jasmine.
jasmineNodeOpts: {
defaultTimeoutInterval: 30000
},
};
you don't need to give below dependencies because chrome get launched from conf file only
chromedriver: 2.33.506092
webdriver: selenium standalone version available: 3.7.1 [last]
Ran into similar issue. Try updating chrome which should fetch the new compatible chrome driver.

“cannot get automation extension” error with chrome version: 57.0.2987.98

chrome version : 57.0.2987.98 m (64-bit)
"protractor": "4.0.11",
"protractor-console-plugin": "0.1.1",
"protractor-jasmine2-html-reporter": "0.0.6",
"protractor-notify-plugin": "1.0.0",
protractor failed to launch chrome with the following error:
unknown error: page could not be found: chrome-extension://aapnijgdinlhnhlmodcfapnahmbfebeb/_generated_background_page.html
(Session info: chrome=57.0.2987.98)
(Driver info: chromedriver=2.26.436362 (5476ec6bf7ccbada1734a0cdec7d570bb042aa30),platform=Windows NT 6.1.7601 SP1 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 10.10 seconds
Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:37:03'
You are using incompatible versions of chromedriver=2.26.436362 and chrome=57.0.2987.98.
As per Chrome driver release notes the error is fixed in ver 2.28 so you should upgrade your Chrome driver (or downgrade the Chrome browser).
upd: if you use angular/webdriver-manager to run Selenium server then you can achieve this by running the following commands:
webdriver-manager update --versions.chrome=2.28
webdriver-manager start --versions.chrome=2.28
Yes, you can use this as a workaround
node ./node_modules/protractor/bin/webdriver-manager update --versions.chrome 2.28
node ./node_modules/protractor/bin/webdriver-manager start --versions.chrome 2.28
Works for my team. Hope it can help you.
Upgrading your protractor version to 5+ should do it. I got the same error, upgraded from 4.0.14 to 5.1.1, and now all my UI tests are passing again.
It seems that protractor doesn't start grabbing the latest version of the chrome driver until Protractor version 5.0, so when you upgrade to a version of Chrome that's incompatible with protractor's chrome driver, it will break your tests in this fun new way.
Source: https://github.com/angular/protractor/blob/master/CHANGELOG.md
This might be because webdriver failed to deal with 3-party Chrome extension.
You can try to set below capabilities in your conf.js file to disable extensions usage:
capabilities: {
'browserName': 'chrome',
'chromeOptions': {
'args': ['--disable-extensions']
}
}

jasmine-reporters modifySuiteName not work?

I'm using protractor with jasmine-reporters 2.0.7
I tried to use the modifySuiteName option to modify suite names.
This is what in my conf.js:
multiCapabilities: [{
browserName: 'firefox'
}, {
browserName: 'chrome'
}],
onPrepare: function() {
var jasmineReporters = require('jasmine-reporters');
return browser.getProcessedConfig().then(function(config) {
var browserName = config.capabilities.browserName;
jasmine.getEnv().addReporter(
new jasmineReporters.JUnitXmlReporter({
savePath: 'c://scripts',
filePrefix: browserName,
consolidateAll: true,
modifySuiteName: function(generatedSuiteName, suite) {
return browserName+ '.' + generatedSuiteName;}
}));
});
},
I suppose to see
testsuite name="chrome.Demo App"
in chrome.xml
and
testsuite name="firefox.Demo App"
in firefox.xml
But I can only see
testsuite name="Demo App"
in both files.
Is there anything wrong in my code?
Okay now I figure out that my issue is caused by a stupid mistake.
I'm using windows 8 and running cmd under the folder c:\scripts.
I'm so new to nodejs and npm that during the set-up process I used npm install --save-dev jasmine-reporters#^2.0.0 and few days later I used npm install -g jasmine-reporters#latest
So there are 2 jasmine-reporters in my system, one in C:\Users\xxx\AppData\Roaming\npm\node_modules\jasmine-reporters
and another in C:\scripts\node_modules\jasmine-reporters,
with version 2.0.7 and 2.0.0 in package.json, respectively.
I just update my jasmine-reporters in C:\scripts\node_modules to 2.0.7 and the script finally works!
Thanks for your time, I really appreciate it.
As far as i see, there is no fault in your code. If your code is generating chrome and firefox xml's then everything with your configuration should be fine. Your code is working perfectly fine in my protractor. I am using Jasmine 2.3.1 with protractor 2.1.0. Try updating your protractor and jasmine framework to the latest version and then run your test suite. To update your jasmine run the below command -
npm update -g jasmine
Also if you have not added the framework tag after multiCapabilities tag in your conf.js file then you should be doing so as shown below -
framework: 'jasmine2',
Hope this solves your issue.

Google chrome 29.0 is not working with webdriver

I was trying to load google chrome browser with watir-webdriver, but while invoking any URL in the browser it is throwing following error
Selenium::WebDriver::Error::UnknownError: Unknown command 'WaitForAllTabsToStopL
oading'. Options: AcceptOrDismissAppModalDialog, ActionOnSSLBlockingPage, Activa
teTab, AddBookmark, AddDomEventObserver, AppendTab, ApplyAccelerator, BringBrows
erToFront, ClearEventQueue, CloseBrowserWindow, CloseTab, CreateNewAutomationPro
vider, DeleteCookie, DeleteCookieInBrowserContext, DoesAutomationObjectExist, Dr
agAndDropFilePaths, ExecuteJavascript, ExecuteJavascriptInRenderView, GetActiveT
abIndex, GetAppModalDialogMessage, GetBookmarkBarStatus, GetBookmarksAsJSON, Get
BrowserInfo, GetBrowserWindowCount, GetChromeDriverAutomationVersion, GetCookies
, GetCookiesInBrowserContext, GetDownloadDirectory, GetExtensionsInfo, GetIndice
sFromTab, GetLocalStatePrefsInfo, GetMultiProfileInfo, GetNextEvent, GetPrefsInf
o, GetProcessInfo, GetSecurityState, GetTabCount, GetTabIds, GetTabInfo, GetView
s, GoBack, GoForward, InstallExtension, IsDownloadShelfVisible, IsFindInPageVisi
ble, IsMenuCommandEnabled, IsPageActionVisible, IsTabIdValid, MaximizeView, Navi
gateToURL, OpenFindInPage, OpenNewBrowserWindow, OpenNewBrowserWindowWithNewProf
ile, OpenProfileWindow, OverrideGeoposition, RefreshPolicies, Reload, RemoveBook
mark, RemoveEventObserver, ReparentBookmark, RunCommand, SendWebkitKeyEvent, Set
BookmarkTitle, SetBookmarkURL, SetCookie, SetCookieInBrowserContext, SetDownload
ShelfVisible, SetExtensionStateById, SetLocalStatePrefs, SetPrefs, SetViewBounds
, SimulateAsanMemoryBug, TriggerBrowserActionById, TriggerPageActionById, Uninst
allExtensionById, UpdateExtensionsNow, WaitForBookmarkModelToLoad, WaitUntilNavi
gationCompletes, WebkitMouseButtonDown, WebkitMouseButtonUp, WebkitMouseClick, W
ebkitMouseDoubleClick, WebkitMouseDrag, WebkitMouseMove, AcceptCurrentFullscreen
OrMouseLockRequest, AddOrEditSearchEngine, AddSavedPassword, CloseNotification,
DenyCurrentFullscreenOrMouseLockRequest, DisablePlugin, EnablePlugin, FindInPage
, GetAllNotifications, GetDownloadsInfo, GetFPS, GetHistoryInfo, GetInitialLoadT
imes, GetNTPInfo, GetNavigationInfo, GetOmniboxInfo, GetPluginsInfo, GetSavedPas
swords, GetSearchEngineInfo, GetV8HeapStats, ImportSettings, IsFullscreenBubbleD
isplayed, IsFullscreenBubbleDisplayingButtons, IsFullscreenForBrowser, IsFullscr
eenForTab, IsFullscreenPermissionRequested, IsMouseLockPermissionRequested, IsMo
useLocked, KillRendererProcess, LaunchApp, LoadSearchEngineInfo, OmniboxAcceptIn
put, OmniboxMovePopupSelection, PerformActionOnDownload, PerformActionOnInfobar,
PerformActionOnSearchEngine, RemoveNTPMostVisitedThumbnail, RemoveSavedPassword
, RestoreAllNTPMostVisitedThumbnails, SaveTabContents, SetAppLaunchType, SetOmni
boxText, SetWindowDimensions, WaitForAllDownloadsToComplete, WaitForNotification
Count,
It might be throwing this error because of Chrome update where as webdriver is not supporting the updated API's,
I also tried to update watir-webdriver gem, but it is saying nothing to update (its up to date) My watir-webdriver version is watir-webdriver-0.6.4
Kindly let me know if any one else is facing the same issue or any one found out the solution for the same.
Gaurav, I've had the same issue.
Here are the steps how i fixed this:
1. Remove old the versions (ruby, watir, devkit)
2. Install to Ruby 2.0.0-p195
3. Install devkit
4. Add latest chromedriver to your $PATH
5. gem install watir-webdriver
6. gem update --system
7. gem update
8. gem cleanup
Also update the chromedriver executable to the latest version (and double check it in your path).
I have: ruby 2.0.0p195 (2013-05-14) [i386-mingw32] && watir-webdriver(0.6.4)
Voila:
C:\Ruby200\bin>irb
irb(main):001:0> require "watir-webdriver"
=> true
irb(main):002:0> b = Watir::Browser.new :chrome
Starting ChromeDriver (v2.2) on port 9515
=> #<Watir::Browser:0x3cac37de url="data:text/html;charset=utf-8," title="data:t
ext/html;charset=utf-8,">
irb(main):003:0> b.goto "stackoverflow.com"
=> "http://stackoverflow.com/"
irb(main):004:0> b.inspect
=> "#<Watir::Browser:0x50eee9c0 url=\"http://stackoverflow.com/\" title=\"Stack
Overflow\">"
Please let me know if it helped.
I am also facing the same issue. I am getting this error exactly when I am trying to navigate to driver.goto("google.com").
But if I revert my Chrome version from 29 to 27 then its working fine. So I think the issue is from chrome version 29 or chrome driver version chromedriver_win32_2.2.zip
So please downgrade the chrome temporarily....
Download the latest version of chromedriver. Also make sure that the old old on NOT in your PATH.
Did you upgrade to the latest version of selenium-webdriver?
gem install selenium-webdriver
Remember that watir-webdriver is just a wrapper around selenium-webdriver. It is actually selenium-webdriver that does the interaction with chromedriver. Typically, when there is an update to chromedriver, there also needs to be an update to selenium-webdriver.
There were 2 updates to selenium-webdriver since the latest chromedriver update. It is possible that one of the updates addressed your issue.
Use the Latest jar file of selenium web driver- selenium-server-standalone-2.35.0.jar
and chromedriver_win32_2.3.zip for chrome driver.
I have seen this issue and we fixed it by moving to ChromeDriver 2.3 in both Mac and Windows
Versions I use:
Ruby version: 1.9.3-p194
Watir-webdriver version: 0.6.4
Selenium-webdriver version: 2.33.0
if you can make sure chrome driver is in the PATH, this should work. No need to upgrade to ruby 2.0.
You would use capabilities to point to the right binary file of the browser to be launced.But not all versions of chrome browser is supported by different versions of chromedriver. You will find exceptions stating that version of browser expected is greater or equal to 30.0.
For ex:- Chromium Browser(33.0.1729.0 )works fine with ChromeDriver 2.7 and not the with the older ones.
You can choose from all the chromedriver version available from the link below:- http://chromedriver.storage.googleapis.com/index.html
So try to use the browser version supported by the chromedriver.