Issue due to ChromeDriver while running with test

My application uses chrome custom tabs. When I am running my test locally with below android.config capabilities, my testScript is running fine.
config.capabilities = [
{
platformName: ‘Android’,
noReset: true,
fullReset: false,
maxInstances: 1,
automationName: ‘uiautomator2’,
deviceName: AndroidInfo.deviceName(),
platformVersion: AndroidInfo.platFormVersion(),
app: AndroidInfo.appName(),
},
];

But when I modify the capabilities by adding browserName, I am facing error
config.capabilities = [
{
platformName: ‘Android’,
noReset: true,
fullReset: false,
maxInstances: 1,
automationName: ‘uiautomator2’,
deviceName: AndroidInfo.deviceName(),
platformVersion: AndroidInfo.platFormVersion(),
browserName: ‘chrome’,
app: AndroidInfo.appName(),
},
];

Error:

[0-0] at getErrorFromResponseBody (/Users/harsha.sharmagelato.com/Dev/work/sandbox/gelato-api-mobile/integration-tests/node_modules/webdriver/build/utils.js:197:12)
[0-0] at NodeJSRequest._request (/Users/harsha.sharmagelato.com/Dev/work/sandbox/gelato-api-mobile/integration-tests/node_modules/webdriver/build/request/index.js:158:60)
[0-0] at processTicksAndRejections (internal/process/task_queues.js:95:5)
[0-0] at async startWebDriverSession (/Users/harsha.sharmagelato.com/Dev/work/sandbox/gelato-api-mobile/integration-tests/node_modules/webdriver/build/utils.js:67:20)
[0-0] at async Function.newSession (/Users/harsha.sharmagelato.com/Dev/work/sandbox/gelato-api-mobile/integration-tests/node_modules/webdriver/build/index.js:46:45)
[0-0] at async remote (/Users/harsha.sharmagelato.com/Dev/work/sandbox/gelato-api-mobile/integration-tests/node_modules/webdriverio/build/index.js:77:22)
[0-0] at async Runner._startSession (/Users/harsha.sharmagelato.com/Dev/work/sandbox/gelato-api-mobile/integration-tests/node_modules/@wdio/runner/build/index.js:223:56)
[0-0] at async Runner._initSession (/Users/harsha.sharmagelato.com/Dev/work/sandbox/gelato-api-mobile/integration-tests/node_modules/@wdio/runner/build/index.js:176:25)
[0-0] at async Runner.run (/Users/harsha.sharmagelato.com/Dev/work/sandbox/gelato-api-mobile/integration-tests/node_modules/@wdio/runner/build/index.js:88:19)
[0-0] 2022-05-04T12:10:32.033Z ERROR @wdio/runner: Error: Failed to create session.
[0-0] An unknown server-side error occurred while processing the command. Original error: No Chromedriver found that can automate Chrome ‘91.0.4472’. You could also try to enable automated chromedrivers download server feature. See https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/web/chromedriver.md for more details
[0-0] at startWebDriverSession (/Users/harsha.sharmagelato.com/Dev/work/sandbox/gelato-api-mobile/integration-tests/node_modules/webdriver/build/utils.js:72:15)
[0-0] at processTicksAndRejections (internal/process/task_queues.js:95:5)
[0-0] at async Function.newSession (/Users/harsha.sharmagelato.com/Dev/work/sandbox/gelato-api-mobile/integration-tests/node_modules/webdriver/build/index.js:46:45)
[0-0] at async remote (/Users/harsha.sharmagelato.com/Dev/work/sandbox/gelato-api-mobile/integration-tests/node_modules/webdriverio/build/index.js:77:22)
[0-0] at async Runner._startSession (/Users/harsha.sharmagelato.com/Dev/work/sandbox/gelato-api-mobile/integration-tests/node_modules/@wdio/runner/build/index.js:223:56)
[0-0] at async Runner._initSession (/Users/harsha.sharmagelato.com/Dev/work/sandbox/gelato-api-mobile/integration-tests/node_modules/@wdio/runner/build/index.js:176:25)
[0-0] at async Runner.run (/Users/harsha.sharmagelato.com/Dev/work/sandbox/gelato-api-mobile/integration-tests/node_modules/@wdio/runner/build/index.js:88:19)
2022-05-04T12:10:32.141Z DEBUG @wdio/local-runner: Runner 0-0 finished with exit code 1
[0-0] FAILED in chrome - /test/features/login1.feature
2022-05-04T12:10:32.141Z INFO @wdio/cli:launcher: Run onWorkerEnd hook
2022-05-04T12:10:32.141Z DEBUG @wdio/cli:utils: Finished to run “onWorkerEnd” hook in 0ms
2022-05-04T12:10:32.141Z INFO @wdio/cli:launcher: Run onComplete hook
2022-05-04T12:10:32.142Z DEBUG @wdio/appium-service: Appium (pid: 70346) killed
2022-05-04T12:10:32.142Z DEBUG @wdio/cli:utils: Finished to run “onComplete” hook in 1ms

Package.json:

My advice is read that and do everything it says.

Thankyou for your reply.

I followed this document and installed the ChromeDriver accordingly. My chromeDriver is installed in /node_modules/appium-chromedriver/chromedriver/mac/chromedriver_mac64_v91.0.4472.101

in my android emulator, chrome version is In my emulator, I have Chrome version: 91.0.4472.114, therefore I installed ChromeDriver using command
npm i [email protected]

< I hope I have done right till here? >

Also, now do I have to update my capabilities?

This is my wdio.conf.ts

const { generate } = require(‘multiple-cucumber-html-reporter’);

exports.config = {

runner: 'local',
specs: [
    '**/login1.feature',
],
exclude: [
    // 'path/to/excluded/files'
],
maxInstances: 10,
capabilities: [{

    maxInstances: 5,
    browserName: 'chrome',
    acceptInsecureCerts: true,
}],

logLevel: 'trace',

baseUrl: 'http://localhost',

services: [
    'appium',
],
appium: {
    command: 'appium --chromedriver-executable /Users/harsha.sharmagelato.com/Dev/work/sandbox/gelato-api-mobile/integration-tests/node_modules/appium-chromedriver/chromedriver/mac/chromedriver_mac64_v91.0.4472.101',
    // args: ['--allow-insecure', 'chromedriver_autodownload'],
},
port: 4723,
path: '/wd/hub',

framework: 'cucumber',
cucumberOpts: {
    backtrace: false,
    requireModule: [],
    failAmbiguousDefinitions: false,
    failFast: false,
    ignoreUndefinedDefinitions: false,
    name: [],
    profile: [],
    require: [
        '**/login.ts',
    ],
    tagExpression: '@androidApp',
    snippetSyntax: undefined,
    snippets: true,
    source: true,
    strict: false,
    tagsInTitle: false,
    timeout: 50000,
    retry: 0,
},

reporters: [
  
],

mochaOpts: {
    ui: 'bdd',
    timeout: 60000,
},

};

And my current capabilities are:

config.capabilities = [
{
platformName: ‘Android’,
noReset: true,
fullReset: false,
maxInstances: 1,
automationName: ‘uiautomator2’,
deviceName: AndroidInfo.deviceName(),
platformVersion: AndroidInfo.platFormVersion(),
app: AndroidInfo.appName(),
},
];

Ok, I’m not sure how you came up with the number 4.27.3. I’m reading here (referenced in the url from the error above):

And that says:

Here are the steps to select the version of ChromeDriver to download:

First, find out which version of Chrome you are using. Let’s say you have Chrome 72.0.3626.81.

Take the Chrome version number, remove the last part, and append the result to URL “https://chromedriver.storage.googleapis.com/LATEST_RELEASE_”. For example, with Chrome version 72.0.3626.81, you’d get a URL “https://chromedriver.storage.googleapis.com/LATEST_RELEASE_72.0.3626”.

So to me it seems like your install command should be:

npm i [email protected]

I don’t think that the mac64 version will work on Android. Hope this helps.

When I run npm i [email protected], I am getting below error:

~/Dev/work/sandbox/repo/integration-tests # npm i [email protected]
(node:91923) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to ‘0’ makes TLS connections and HTTPS requests insecure by disabling certificate verification.
(Use node --trace-warnings ... to show where the warning was created)
npm ERR! code ETARGET
npm ERR! notarget No matching version found for [email protected].
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn’t exist.

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/harsha.sharmagelato.com/.npm/_logs/2022-05-05T08_27_17_767Z-debug.log

And when I run npm i [email protected]

~/Dev/work/sandbox/repo/integration-tests # npm i [email protected]
(node:92253) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to ‘0’ makes TLS connections and HTTPS requests insecure by disabling certificate verification.
(Use node --trace-warnings ... to show where the warning was created)
npm WARN deprecated @dabh/[email protected]: @dabh/colors has been renamed to @colors/colors. Please update your package.json.
npm notice Beginning October 4, 2021, all connections to the npm registry - including for package installation - must use TLS 1.2 or higher. You are currently using plaintext http to connect. Please visit the GitHub blog for more information: The npm registry is deprecating TLS 1.0 and TLS 1.1 - The GitHub Blog

[email protected] postinstall /Users/harsha.sharmagelato.com/Dev/work/sandbox/gelato-api-mobile/integration-tests/node_modules/appium-chromedriver
node install-npm.js

(node:92297) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to ‘0’ makes TLS connections and HTTPS requests insecure by disabling certificate verification.
(Use node --trace-warnings ... to show where the warning was created)
dbug ChromedriverStorageClient Parsed 612 entries from storage XML
info ChromedriverStorageClient The total count of entries in the mapping: 434
dbug ChromedriverStorageClient Selecting chromedrivers whose versions match to 91.0.4472.101
dbug ChromedriverStorageClient Got 4 items
dbug ChromedriverStorageClient Selecting chromedrivers whose platform matches to mac64
dbug ChromedriverStorageClient Got 1 item
dbug ChromedriverStorageClient Got 1 driver to sync: [
dbug ChromedriverStorageClient “91.0.4472.101/chromedriver_mac64.zip”
dbug ChromedriverStorageClient ]
dbug ChromedriverStorageClient Retrieving ‘https://chromedriver.storage.googleapis.com/91.0.4472.101/chromedriver_mac64.zip’ to ‘/var/folders/ng/j1x2zw3d6_9d_tsgmh3skv880000gn/T/202245-92297-2v7agz.c40uy/0.zip’
dbug Support Traversed 1 directory and 1 file in 1ms
dbug ChromedriverStorageClient Moving the extracted ‘chromedriver’ to ‘/Users/harsha.sharmagelato.com/Dev/work/sandbox/gelato-api-mobile/integration-tests/node_modules/appium-chromedriver/chromedriver/mac/chromedriver_mac64_v91.0.4472.101’
dbug ChromedriverStorageClient Permissions of the file ‘/Users/harsha.sharmagelato.com/Dev/work/sandbox/gelato-api-mobile/integration-tests/node_modules/appium-chromedriver/chromedriver/mac/chromedriver_mac64_v91.0.4472.101’ have been changed to 755
info ChromedriverStorageClient Successfully synchronized 1 chromedriver
npm WARN [email protected] No repository field.

109 packages are looking for funding
run npm fund for details

I also tried npm i [email protected]

~/Dev/work/sandbox/repo/integration-tests # npm i [email protected]
(node:92827) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to ‘0’ makes TLS connections and HTTPS requests insecure by disabling certificate verification.
(Use node --trace-warnings ... to show where the warning was created)
npm ERR! code ETARGET
npm ERR! notarget No matching version found for [email protected].
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn’t exist.

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/harsha.sharmagelato.com/.npm/_logs/2022-05-05T08_34_19_118Z-debug.log

Am I missing something here?

Ok, I still don’t understand where you got the number 4.27.3. But I’m looking into this further.

You said you did everything in the Chromedriver readme. How are you starting Appium? You’ve tried this:

appium --chromedriver-executable /path/to/my/chromedriver

I solved this issue myself yesterday. What I did:

Added “chromedriver”: “^91.0.0”, dependency in package.json myself and then ran npm install

Also, I added chromedriverExecutable: ‘<YOUR_REPO>/node_modules/chromedriver/lib/chromedriver/chromedriver’, in Android capabilities.

This worked for me!

1 Like

Thanks for all your inputs :slight_smile:

Glad you were able to solve it.