Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standalone server and point to a wrong path. Please set path: '/wd/hub' in your wdio.conf.js #5557

Closed
amrsa1 opened this issue Jun 29, 2020 · 39 comments
Labels
Bug 🐛 help wanted Issues that are free to take by anyone interested Needs Investigation Issues that require more information on the problem.

Comments

@amrsa1
Copy link
Contributor

amrsa1 commented Jun 29, 2020

Environment (please complete the following information):

  • WebdriverIO version: 6.1.20
  • Mode: [Standalone mode or WDIO Testrunner]
  • If WDIO Testrunner, running sync/async: sync
  • Node.js version: 12.16.1
  • NPM version: 6.13.4
  • Browser name and version: 83
  • Platform name and version: ubuntu 20.04LTS
  • Additional wdio packages used (if applicable):
    "@wdio/allure-reporter": "^6.1.14", "@wdio/appium-service": "^6.1.16", "@wdio/dot-reporter": "^6.1.14", "@wdio/local-runner": "^6.1.20", "@wdio/mocha-framework": "^6.1.19", "@wdio/selenium-standalone-service": "^6.1.14", "@wdio/spec-reporter": "^6.1.14", "@wdio/sync": "^6.1.14", "chai": "^4.2.0", "chromedriver": "^83.0.0", "wdio-chromedriver-service": "^6.0.3"

Config of WebdriverIO
you can find it in the url provided below

Describe the bug
Unable to trigger certain capabilities when using multi-remote feature as it seems ports are overlapping each other and throws an error as shown in the screenshot attached below

To Reproduce

  • Pull the code in the repo
  • git checkout to master (example branch is the default)
  • run 'npm i'
  • run 'npm run test'

https://github.com/Amrkamel1/wdExample/tree/master

Expected behavior
I should be able to run certain capabilities separately

Log
image

Additional context
Add any other context about the problem here.

@christian-bromann christian-bromann added Bug 🐛 good first pick a reasonable task to start getting familiar with the code base help wanted Issues that are free to take by anyone interested labels Jul 1, 2020
@christian-bromann
Copy link
Member

Hey,
thanks for filing the issue. This seems indeed like bug. We would appreciate any help on this so please help us out! Have a look at our contributing guidelines and reach out if you have any questions. Cheers!

@christian-bromann christian-bromann added the first-timers-only Issues that are well described and directed for people that start contributing to the project label Jul 22, 2020
@hieuxlu
Copy link
Member

hieuxlu commented Jul 28, 2020

@christian-bromann It seems since this commit c5a0167, every capabilities will be overridden with /wd/hub by wdio-selenium-standalone-service and with / by wdio-appium-service, so I understand that by design these services can not be used together. Is it correct that this is your intention to do so?

        (
            Array.isArray(this.capabilities)
                ? this.capabilities
                : Object.values(this.capabilities)
        ).forEach((cap) => Object.assign(cap, DEFAULT_CONNECTION, { ...cap }))

@amrkamel1 Can you try specifying path in capabilities for Appium, as this might override default value provided by the service. For example:

{
    "platformName": "iOS",
    "platformVersion": "11.0",
    "deviceName": "iPhone 7",
    "automationName": "XCUITest",
    "app": "/path/to/my.app"
+  "path": "/"
}

I don't know what is the use case of using these 2 services together, but maybe the above approach will work.

@amrsa1
Copy link
Contributor Author

amrsa1 commented Jul 28, 2020

@hieuxlu

im not quite sure if i understand u, this path should be path to what

 androidClient: {
      port: 4723,
      capabilities: {
        platformName: 'Android',
        browserName: 'chrome',
        'appium:deviceName': 'pixel2',
        'appium:avd': 'pixel2',
        'appium:platformVersion': '10',
        **path: '/'**
    }

@christian-bromann
Copy link
Member

Is it correct that this is your intention to do so?

@hieuxlu yes. Users still can set the path properly in the config to run both services together. Unfortunately the selenium-standalone server requires the path to be on /wd/hub. Your suggestion should work. If you have a better solution how to handle this, please let us know. Cheers!

@hieuxlu
Copy link
Member

hieuxlu commented Jul 29, 2020

@amrkamel1 That should be that path to Appium server, I think by default it should be /wd/hub. If you don't explicitly set path in either config or capabilities, by default, wdio-appium-service will override it with /, which will result in error for selenium-standalone.

For this reason, you should either set path: '/wd/hub' in wdio config, or in each capabilities if somehow the endpoint for Appium and selenium-standalone is different. I would suggest trying setting path in wdio.conf.js first

exports.config = {
+ path: '/wd/hub', 
  specs: ['./test/specs/*.spec.js'],

https://github.com/Amrkamel1/wdExample/blob/master/wdio.conf.js

@amrsa1
Copy link
Contributor Author

amrsa1 commented Jul 29, 2020

@hieuxlu

no luck, still unable execute the test, im getting the erro below

image

@hieuxlu
Copy link
Member

hieuxlu commented Jul 29, 2020

This is different, I can see that Appium server did start successfully, so original error should be resolved. The above error should be related to loglevel, you might want setting loglevel explicitly

@christian-bromann
Copy link
Member

@amrkamel1 maybe try to reinstall the dependencies, that looks like an odd error.

@amrsa1
Copy link
Contributor Author

amrsa1 commented Jul 29, 2020

@christian-bromann @hieuxlu

i have already deleted the entire node_modules and reinstall everything, still getting errors as shown below

`2020-07-29T12:07:29.743Z DEBUG @wdio/utils:initialiseServices: initialise service "selenium-standalone" as NPM package
2020-07-29T12:07:29.744Z DEBUG @wdio/utils:initialiseServices: initialise service "appium" as NPM package
2020-07-29T12:07:29.746Z INFO @wdio/cli:launcher: Run onPrepare hook
2020-07-29T12:07:29.755Z DEBUG @wdio/appium-service: Will spawn Appium process: cmd /c appium --base-path / --debug-log-spacing --session-override --port 4728
2020-07-29T12:07:31.185Z DEBUG @wdio/appium-service: Appium started with ID: 5496
2020-07-29T12:07:31.953Z INFO @wdio/cli:launcher: Run onWorkerStart hook
2020-07-29T12:07:31.957Z INFO @wdio/local-runner: Start worker 0-0 with arg: wdio.conf.js
[0-0] 2020-07-29T12:07:32.514Z INFO @wdio/local-runner: Run worker command: run
[0-0] 2020-07-29T12:07:33.394Z DEBUG @wdio/local-runner:utils: init multiremote session
[0-0] 2020-07-29T12:07:33.397Z INFO webdriverio: Initiate new session using the ./protocol-stub protocol
[0-0] 2020-07-29T12:07:33.398Z INFO webdriverio: Initiate new session using the ./protocol-stub protocol
[0-0] RUNNING in MultiRemote - C:\Users\amrka\Desktop\wdExample\test\specs\test.spec.js
[0-0] 2020-07-29T12:07:33.424Z DEBUG @wdio/utils:initialiseServices: initialise service "selenium-standalone" as NPM package
2020-07-29T12:07:33.425Z DEBUG @wdio/utils:initialiseServices: initialise service "appium" as NPM package
[0-0] 2020-07-29T12:07:33.426Z DEBUG @wdio/local-runner:utils: init multiremote session
[0-0] 2020-07-29T12:07:33.427Z INFO webdriverio: Initiate new session using the webdriver protocol
2020-07-29T12:07:33.427Z INFO webdriverio: Initiate new session using the webdriver protocol
[0-0] 2020-07-29T12:07:33.428Z INFO webdriver: [POST] http://localhost:4728/session
[0-0] 2020-07-29T12:07:33.428Z INFO webdriver: DATA {
  capabilities: {
    alwaysMatch: { browserName: 'chrome', platformName: 'chrome', path: '/wd/hub' },
    firstMatch: [ {} ]
  },
  desiredCapabilities: { browserName: 'chrome', platformName: 'chrome', path: '/wd/hub' }
}
[0-0] 2020-07-29T12:07:33.435Z INFO webdriver: [POST] http://localhost:4728/session
2020-07-29T12:07:33.435Z INFO webdriver: DATA {
  capabilities: {
    alwaysMatch: {
      platformName: 'Android',
      browserName: 'chrome',
      'appium:deviceName': 'pixel2',
      'appium:avd': 'pixel2',
      'appium:platformVersion': '10',
      'appium:avdLaunchTimeout': 120000,
      'appium:avdReadyTimeout': 120000,
      'appium:uiautomator2ServerInstallTimeout': 120000,
      'appium:appWaitForLaunch': true,
      'appium:ensureWebviewsHavePages': true,
      'appium:disableWindowAnimation': true,
      'appium:autoGrantPermissions': true,
      'appium:clearSystemFiles': true,
      'appium:nativeWebScreenshot': true,
      path: '/wd/hub'
    },
    firstMatch: [ {} ]
  },
  desiredCapabilities: {
    platformName: 'Android',
    browserName: 'chrome',
    'appium:deviceName': 'pixel2',
    'appium:avd': 'pixel2',
    'appium:platformVersion': '10',
    'appium:avdLaunchTimeout': 120000,
    'appium:avdReadyTimeout': 120000,
    'appium:uiautomator2ServerInstallTimeout': 120000,
    'appium:appWaitForLaunch': true,
    'appium:ensureWebviewsHavePages': true,
    'appium:disableWindowAnimation': true,
    'appium:autoGrantPermissions': true,
    'appium:clearSystemFiles': true,
    'appium:nativeWebScreenshot': true,
    path: '/wd/hub'
  }
}
[0-0] 2020-07-29T12:07:33.576Z DEBUG webdriver: request failed due to status 13
[0-0] 2020-07-29T12:07:33.576Z WARN webdriver: Request failed with status 500 due to An unknown server-side error occurred while processing the command. Original error: Cannot read property 'toLowerCase' of undefined
[0-0] 2020-07-29T12:07:33.576Z INFO webdriver: Retrying 1/3
2020-07-29T12:07:33.576Z INFO webdriver: [POST] http://localhost:4728/session
2020-07-29T12:07:33.577Z INFO webdriver: DATA {
  capabilities: {
    alwaysMatch: { browserName: 'chrome', platformName: 'chrome', path: '/wd/hub' },
    firstMatch: [ {} ]
  },
  desiredCapabilities: { browserName: 'chrome', platformName: 'chrome', path: '/wd/hub' }
}
[0-0] 2020-07-29T12:07:33.868Z DEBUG webdriver: request failed due to status 13
[0-0] 2020-07-29T12:07:33.868Z WARN webdriver: Request failed with status 500 due to An unknown server-side error occurred while processing the command. Original error: Cannot read property 'toLowerCase' of undefined
[0-0] 2020-07-29T12:07:33.868Z INFO webdriver: Retrying 2/3
2020-07-29T12:07:33.868Z INFO webdriver: [POST] http://localhost:4728/session
2020-07-29T12:07:33.868Z INFO webdriver: DATA {
  capabilities: {
    alwaysMatch: { browserName: 'chrome', platformName: 'chrome', path: '/wd/hub' },
    firstMatch: [ {} ]
  },
  desiredCapabilities: { browserName: 'chrome', platformName: 'chrome', path: '/wd/hub' }
}
[0-0] 2020-07-29T12:07:33.912Z DEBUG webdriver: request failed due to status 13
[0-0] 2020-07-29T12:07:33.912Z WARN webdriver: Request failed with status 500 due to An unknown server-side error occurred while processing the command. Original error: Cannot read property 'toLowerCase' of undefined
[0-0] 2020-07-29T12:07:33.912Z INFO webdriver: Retrying 3/3
2020-07-29T12:07:33.912Z INFO webdriver: [POST] http://localhost:4728/session
2020-07-29T12:07:33.912Z INFO webdriver: DATA {
  capabilities: {
    alwaysMatch: { browserName: 'chrome', platformName: 'chrome', path: '/wd/hub' },
    firstMatch: [ {} ]
  },
  desiredCapabilities: { browserName: 'chrome', platformName: 'chrome', path: '/wd/hub' }
}
[0-0] 2020-07-29T12:07:33.926Z DEBUG webdriver: request failed due to status 13
[0-0] 2020-07-29T12:07:33.926Z ERROR webdriver: Request failed with status 500 due to Error: An unknown server-side error occurred while processing the command. Original error: Cannot read property 'toLowerCase' of undefined 
2020-07-29T12:07:33.927Z ERROR webdriver: Error: An unknown server-side error occurred while processing the command. Original error: Cannot read property 'toLowerCase' of undefined
    at getErrorFromResponseBody (C:\Users\amrka\Desktop\wdExample\node_modules\webdriver\build\utils.js:121:10)
    at WebDriverRequest._request (C:\Users\amrka\Desktop\wdExample\node_modules\webdriver\build\request.js:149:56)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async startWebDriverSession (C:\Users\amrka\Desktop\wdExample\node_modules\webdriver\build\utils.js:41:16)
    at async Function.newSession (C:\Users\amrka\Desktop\wdExample\node_modules\webdriver\build\index.js:44:23)
    at async remote (C:\Users\amrka\Desktop\wdExample\node_modules\webdriverio\build\index.js:75:20)
    at async C:\Users\amrka\Desktop\wdExample\node_modules\webdriverio\build\index.js:104:22
    at async Promise.all (index 0)
    at async multiremote (C:\Users\amrka\Desktop\wdExample\node_modules\webdriverio\build\index.js:103:3)
    at async initialiseInstance (C:\Users\amrka\Desktop\wdExample\node_modules\@wdio\runner\build\utils.js:81:19)
[0-0]  Error:  Failed to create session.
An unknown server-side error occurred while processing the command. Original error: Cannot read property 'toLowerCase' of undefined
[0-0] 2020-07-29T12:07:33.927Z ERROR @wdio/runner: Error: Failed to create session.
An unknown server-side error occurred while processing the command. Original error: Cannot read property 'toLowerCase' of undefined
    at startWebDriverSession (C:\Users\amrka\Desktop\wdExample\node_modules\webdriver\build\utils.js:45:11)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
2020-07-29T12:07:34.041Z DEBUG @wdio/local-runner: Runner 0-0 finished with exit code 1
[0-0] FAILED in MultiRemote - C:\Users\amrka\Desktop\wdExample\test\specs\test.spec.js
2020-07-29T12:07:34.043Z INFO @wdio/cli:launcher: Run onComplete hook
2020-07-29T12:07:34.043Z INFO @wdio/selenium-standalone-service: shutting down all browsers
2020-07-29T12:07:34.044Z DEBUG @wdio/appium-service: Appium (pid: 18320) killed

Spec Files:      0 passed, 1 failed, 1 total (100% completed) in 00:00:04`

@christian-bromann
Copy link
Member

@amrkamel1 this is a different error now, see error message:

Cannot read property 'toLowerCase' of undefined
    at getErrorFromResponseBody (C:\Users\amrka\Desktop\wdExample\node_modules\webdriver\build\utils.js:121:10)

Please check why the error is being thrown there.

@amrsa1
Copy link
Contributor Author

amrsa1 commented Jul 29, 2020

@christian-bromann

okay i solved this toLowerCase issue , after that i have tried the approach provided above and still getting the very first error, check below my wdio config

`exports.config = {
  specs: ['./test/specs/*.spec.js'],
  path: '/wd/hub',


  capabilities: {
    myChromeBrowser: {
      port: 4444,
        capabilities: {
            browserName: 'chrome',
            // path: '/wd/hub'
        }
    },
    androidClient: {
      port: 4728,
      capabilities: {
        platformName: 'Android',
        browserName: 'chrome',
        'appium:deviceName': 'pixel2',
        'appium:avd': 'pixel2',
        'appium:platformVersion': '10',
        'appium:avdLaunchTimeout': 120000,
        'appium:avdReadyTimeout': 120000,
        'appium:uiautomator2ServerInstallTimeout' :120000,
        'appium:appWaitForLaunch': true,
        'appium:ensureWebviewsHavePages': true,
        'appium:disableWindowAnimation': true,
        'appium:autoGrantPermissions': true,
        'appium:clearSystemFiles': true,
        'appium:nativeWebScreenshot': true,
            // path: '/wd/hub'
          }
  }
},

  sync: true,
  logLevel: 'trace',
  coloredLogs: true,
  baseUrl: 'http://demo.virtocommerce.com/',
  waitforTimeout: 10000,
  connectionRetryTimeout: 90000,
  connectionRetryCount: 3,
  framework: 'mocha',
  reporters: ['spec','dot'],
  maxInstances: 2,

services: [
  ['selenium-standalone', {
      args: {
        seleniumArgs: ['-port', '4444']
      },
  }],  
  ['appium',{
    command : 'appium',
    args: {
        debugLogSpacing: true,
        sessionOverride: true,
        port: 4728,
    },
  }]
],

  mochaOpts: {
    ui: 'bdd'
  },
}
`

image

@christian-bromann
Copy link
Member

@amrkamel1 please the comment from above:

For this reason, you should either set path: '/wd/hub' in wdio config, or in each capabilities if somehow the endpoint for Appium and selenium-standalone is different

@amrsa1
Copy link
Contributor Author

amrsa1 commented Jul 29, 2020

@christian-bromann

i have already try all this different combination, putting "path: '/wd/hub' in wido config didnt work

the i comment that line and i added path in each caps doesn't work , then i added path: '/wd/hub' in wdio config and inside caps as well didnt work

then i used path: '/' in wdio config and removed path from caps, didnt work
then i comment it and added inside caps, didnt work

then i added i added one path: '/' and other "path: '/wd/hub' and vice also didnt work

i was getting same error for all of these tries

@christian-bromann
Copy link
Member

christian-bromann commented Jul 29, 2020

Sorry, from your code snippets it seemed that you commented that out which is why I was pointed it out. Can you try:

exports.config = {
  specs: ['./test/specs/*.spec.js'],

  capabilities: {
    myChromeBrowser: {
      port: 4444,
      path: '/wd/hub'
      capabilities: {
        browserName: 'chrome',
        path: '/wd/hub'
      }
    },
    androidClient: {
      port: 4728,
      path: '/wd/hub'
      capabilities: {
        path: '/wd/hub'
        platformName: 'Android',
        browserName: 'chrome',
        'appium:deviceName': 'pixel2',
        'appium:avd': 'pixel2',
        'appium:platformVersion': '10',
        'appium:avdLaunchTimeout': 120000,
        'appium:avdReadyTimeout': 120000,
        'appium:uiautomator2ServerInstallTimeout' :120000,
        'appium:appWaitForLaunch': true,
        'appium:ensureWebviewsHavePages': true,
        'appium:disableWindowAnimation': true,
        'appium:autoGrantPermissions': true,
        'appium:clearSystemFiles': true,
        'appium:nativeWebScreenshot': true
      }
    }
  },
  // ...
}

@amrsa1
Copy link
Contributor Author

amrsa1 commented Jul 29, 2020

@christian-bromann same error

`2020-07-29T14:32:22.539Z DEBUG @wdio/utils:initialiseServices: initialise service "selenium-standalone" as NPM package
2020-07-29T14:32:22.542Z DEBUG @wdio/utils:initialiseServices: initialise service "appium" as NPM package
2020-07-29T14:32:22.544Z INFO @wdio/cli:launcher: Run onPrepare hook
2020-07-29T14:32:22.549Z DEBUG @wdio/appium-service: Will spawn Appium process: cmd /c appium --base-path / --debug-log-spacing --session-override --port 4728
2020-07-29T14:32:24.039Z DEBUG @wdio/appium-service: Appium started with ID: 9120
2020-07-29T14:32:24.444Z INFO @wdio/cli:launcher: Run onWorkerStart hook
2020-07-29T14:32:24.448Z INFO @wdio/local-runner: Start worker 0-0 with arg: wdio.conf.js
[0-0] 2020-07-29T14:32:24.988Z INFO @wdio/local-runner: Run worker command: run
[0-0] 2020-07-29T14:32:25.849Z DEBUG @wdio/local-runner:utils: init multiremote session
[0-0] 2020-07-29T14:32:25.852Z INFO webdriverio: Initiate new session using the ./protocol-stub protocol
[0-0] 2020-07-29T14:32:25.853Z INFO webdriverio: Initiate new session using the ./protocol-stub protocol
[0-0] RUNNING in MultiRemote - C:\Users\amrka\Desktop\wdExample\test\specs\test.spec.js
[0-0] 2020-07-29T14:32:25.878Z DEBUG @wdio/utils:initialiseServices: initialise service "selenium-standalone" as NPM package
2020-07-29T14:32:25.879Z DEBUG @wdio/utils:initialiseServices: initialise service "appium" as NPM package
2020-07-29T14:32:25.879Z DEBUG @wdio/local-runner:utils: init multiremote session
[0-0] 2020-07-29T14:32:25.881Z INFO webdriverio: Initiate new session using the webdriver protocol
2020-07-29T14:32:25.881Z INFO webdriverio: Initiate new session using the webdriver protocol
[0-0] 2020-07-29T14:32:25.883Z INFO webdriver: [POST] http://localhost:4444/session
[0-0] 2020-07-29T14:32:25.884Z INFO webdriver: DATA {
  capabilities: {
    alwaysMatch: { browserName: 'chrome', path: '/wd/hub' },
    firstMatch: [ {} ]
  },
  desiredCapabilities: { browserName: 'chrome', path: '/wd/hub' }
}
[0-0] 2020-07-29T14:32:25.889Z INFO webdriver: [POST] http://localhost:4728/wd/hub/session
[0-0] 2020-07-29T14:32:25.890Z INFO webdriver: DATA {
  capabilities: {
    alwaysMatch: {
      platformName: 'Android',
      browserName: 'chrome',
      'appium:deviceName': 'pixel2',
      'appium:avd': 'pixel2',
      'appium:platformVersion': '10',
      'appium:avdLaunchTimeout': 120000,
      'appium:avdReadyTimeout': 120000,
      'appium:uiautomator2ServerInstallTimeout': 120000,
      'appium:appWaitForLaunch': true,
      'appium:ensureWebviewsHavePages': true,
      'appium:disableWindowAnimation': true,
      'appium:autoGrantPermissions': true,
      'appium:clearSystemFiles': true,
      'appium:nativeWebScreenshot': true
    },
    firstMatch: [ {} ]
  },
  desiredCapabilities: {
    platformName: 'Android',
    browserName: 'chrome',
    'appium:deviceName': 'pixel2',
    'appium:avd': 'pixel2',
    'appium:platformVersion': '10',
    'appium:avdLaunchTimeout': 120000,
    'appium:avdReadyTimeout': 120000,
    'appium:uiautomator2ServerInstallTimeout': 120000,
    'appium:appWaitForLaunch': true,
    'appium:ensureWebviewsHavePages': true,
    'appium:disableWindowAnimation': true,
    'appium:autoGrantPermissions': true,
    'appium:clearSystemFiles': true,
    'appium:nativeWebScreenshot': true
  }
}
[0-0] 2020-07-29T14:32:25.929Z DEBUG webdriver: request failed due to missing body
[0-0] 2020-07-29T14:32:25.930Z WARN webdriver: Request failed with status 404 due to <!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <link rel="stylesheet" type="text/css" href="/assets/displayhelpservlet.css" media="all"/>
  <link href="/assets/favicon.ico" rel="icon" type="image/x-icon" />
  <script src="/assets/jquery-3.1.1.min.js" type="text/javascript"></script>
  <script src="/assets/displayhelpservlet.js" type="text/javascript"></script>
  <script type="text/javascript">
    var json = Object.freeze('{"consoleLink": "\u002fwd\u002fhub","type": "Standalone","class": "org.openqa.grid.web.servlet.DisplayHelpHandler$DisplayHelpServletConfig","version": "3.141.59"}');
  </script>
</head>
<body>

<div id="content">
  <div id="help-heading">
    <h1><span id="logo"></span></h1>
    <h2>Selenium <span class="se-type"></span>&nbsp;v.<span class="se-version"></span></h2>
  </div>

  <div id="content-body">
    <p>
      Whoops! The URL specified routes to this help page.
    </p>
    <p>
      For more information about Selenium <span class="se-type"></span> please see the
      <a class="se-docs">docs</a> and/or visit the <a class="se-wiki">wiki</a>.
      <span id="console-item">
        Or perhaps you are looking for the Selenium <span class="se-type"></span> <a class="se-console">console</a>.
      </span>
    </p>
    <p>
      Happy Testing!
    </p>
  </div>

  <div>
    <footer id="help-footer">
      Selenium is made possible through the efforts of our open source community, contributions from
      these <a href="https://github.com/SeleniumHQ/selenium/blob/master/AUTHORS">people</a>, and our
      <a href="http://www.seleniumhq.org/sponsors/">sponsors</a>.
   </footer>
  </div>
 </div>

</body>
</html>
[0-0] 2020-07-29T14:32:25.930Z INFO webdriver: Retrying 1/3
2020-07-29T14:32:25.930Z INFO webdriver: [POST] http://localhost:4444/session
2020-07-29T14:32:25.930Z INFO webdriver: DATA {
  capabilities: {
    alwaysMatch: { browserName: 'chrome', path: '/wd/hub' },
    firstMatch: [ {} ]
  },
  desiredCapabilities: { browserName: 'chrome', path: '/wd/hub' }
}
2020-07-29T14:32:25.939Z DEBUG webdriver: request failed due to missing body
2020-07-29T14:32:25.940Z INFO webdriver: Retrying 2/3
2020-07-29T14:32:25.940Z INFO webdriver: [POST] http://localhost:4444/session
2020-07-29T14:32:25.940Z INFO webdriver: DATA {
  capabilities: {
    alwaysMatch: { browserName: 'chrome', path: '/wd/hub' },
    firstMatch: [ {} ]
  },
  desiredCapabilities: { browserName: 'chrome', path: '/wd/hub' }
}
2020-07-29T14:32:25.947Z DEBUG webdriver: request failed due to missing body
2020-07-29T14:32:25.947Z INFO webdriver: Retrying 3/3
2020-07-29T14:32:25.948Z INFO webdriver: [POST] http://localhost:4444/session
2020-07-29T14:32:25.948Z INFO webdriver: DATA {
  capabilities: {
    alwaysMatch: { browserName: 'chrome', path: '/wd/hub' },
    firstMatch: [ {} ]
  },
  desiredCapabilities: { browserName: 'chrome', path: '/wd/hub' }
}
[0-0] 2020-07-29T14:32:25.940Z WARN webdriver: Request failed with status 404 due to <!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <link rel="stylesheet" type="text/css" href="/assets/displayhelpservlet.css" media="all"/>
  <link href="/assets/favicon.ico" rel="icon" type="image/x-icon" />
  <script src="/assets/jquery-3.1.1.min.js" type="text/javascript"></script>
  <script src="/assets/displayhelpservlet.js" type="text/javascript"></script>
  <script type="text/javascript">
    var json = Object.freeze('{"consoleLink": "\u002fwd\u002fhub","type": "Standalone","class": "org.openqa.grid.web.servlet.DisplayHelpHandler$DisplayHelpServletConfig","version": "3.141.59"}');
  </script>
</head>
<body>

<div id="content">
  <div id="help-heading">
    <h1><span id="logo"></span></h1>
    <h2>Selenium <span class="se-type"></span>&nbsp;v.<span class="se-version"></span></h2>
  </div>

  <div id="content-body">
    <p>
      Whoops! The URL specified routes to this help page.
    </p>
    <p>
      For more information about Selenium <span class="se-type"></span> please see the
      <a class="se-docs">docs</a> and/or visit the <a class="se-wiki">wiki</a>.
      <span id="console-item">
        Or perhaps you are looking for the Selenium <span class="se-type"></span> <a class="se-console">console</a>.
      </span>
    </p>
    <p>
      Happy Testing!
    </p>
  </div>

  <div>
    <footer id="help-footer">
      Selenium is made possible through the efforts of our open source community, contributions from
      these <a href="https://github.com/SeleniumHQ/selenium/blob/master/AUTHORS">people</a>, and our
      <a href="http://www.seleniumhq.org/sponsors/">sponsors</a>.
   </footer>
  </div>
 </div>

</body>
</html>
2020-07-29T14:32:25.947Z WARN webdriver: Request failed with status 404 due to <!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <link rel="stylesheet" type="text/css" href="/assets/displayhelpservlet.css" media="all"/>
  <link href="/assets/favicon.ico" rel="icon" type="image/x-icon" />
  <script src="/assets/jquery-3.1.1.min.js" type="text/javascript"></script>
  <script src="/assets/displayhelpservlet.js" type="text/javascript"></script>
  <script type="text/javascript">
    var json = Object.freeze('{"consoleLink": "\u002fwd\u002fhub","type": "Standalone","class": "org.openqa.grid.web.servlet.DisplayHelpHandler$DisplayHelpServletConfig","version": "3.141.59"}');
  </script>
</head>
<body>

<div id="content">
  <div id="help-heading">
    <h1><span id="logo"></span></h1>
    <h2>Selenium <span class="se-type"></span>&nbsp;v.<span class="se-version"></span></h2>
  </div>

  <div id="content-body">
    <p>
      Whoops! The URL specified routes to this help page.
    </p>
    <p>
      For more information about Selenium <span class="se-type"></span> please see the
      <a class="se-docs">docs</a> and/or visit the <a class="se-wiki">wiki</a>.
      <span id="console-item">
        Or perhaps you are looking for the Selenium <span class="se-type"></span> <a class="se-console">console</a>.
      </span>
    </p>
    <p>
      Happy Testing!
    </p>
  </div>

  <div>
    <footer id="help-footer">
      Selenium is made possible through the efforts of our open source community, contributions from
      these <a href="https://github.com/SeleniumHQ/selenium/blob/master/AUTHORS">people</a>, and our
      <a href="http://www.seleniumhq.org/sponsors/">sponsors</a>.
   </footer>
  </div>
 </div>

</body>
</html>
2020-07-29T14:32:25.953Z ERROR webdriver: Request failed with status 404 due to Error: <!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <link rel="stylesheet" type="text/css" href="/assets/displayhelpservlet.css" media="all"/>
  <link href="/assets/favicon.ico" rel="icon" type="image/x-icon" />
  <script src="/assets/jquery-3.1.1.min.js" type="text/javascript"></script>
  <script src="/assets/displayhelpservlet.js" type="text/javascript"></script>
  <script type="text/javascript">
    var json = Object.freeze('{"consoleLink": "\u002fwd\u002fhub","type": "Standalone","class": "org.openqa.grid.web.servlet.DisplayHelpHandler$DisplayHelpServletConfig","version": "3.141.59"}');
  </script>
</head>
<body>

<div id="content">
  <div id="help-heading">
    <h1><span id="logo"></span></h1>
    <h2>Selenium <span class="se-type"></span>&nbsp;v.<span class="se-version"></span></h2>
  </div>

  <div id="content-body">
    <p>
      Whoops! The URL specified routes to this help page.
    </p>
    <p>
      For more information about Selenium <span class="se-type"></span> please see the
      <a class="se-docs">docs</a> and/or visit the <a class="se-wiki">wiki</a>.
      <span id="console-item">
        Or perhaps you are looking for the Selenium <span class="se-type"></span> <a class="se-console">console</a>.
      </span>
    </p>
    <p>
      Happy Testing!
    </p>
  </div>

  <div>
    <footer id="help-footer">
      Selenium is made possible through the efforts of our open source community, contributions from
      these <a href="https://github.com/SeleniumHQ/selenium/blob/master/AUTHORS">people</a>, and our
      <a href="http://www.seleniumhq.org/sponsors/">sponsors</a>.
   </footer>
  </div>
 </div>

</body>
</html>
2020-07-29T14:32:25.953Z ERROR webdriver: Error: <!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <link rel="stylesheet" type="text/css" href="/assets/displayhelpservlet.css" media="all"/>
  <link href="/assets/favicon.ico" rel="icon" type="image/x-icon" />
  <script src="/assets/jquery-3.1.1.min.js" type="text/javascript"></script>
  <script src="/assets/displayhelpservlet.js" type="text/javascript"></script>
  <script type="text/javascript">
    var json = Object.freeze('{"consoleLink": "\u002fwd\u002fhub","type": "Standalone","class": "org.openqa.grid.web.servlet.DisplayHelpHandler$DisplayHelpServletConfig","version": "3.141.59"}');
  </script>
</head>
<body>

<div id="content">
  <div id="help-heading">
    <h1><span id="logo"></span></h1>
    <h2>Selenium <span class="se-type"></span>&nbsp;v.<span class="se-version"></span></h2>
  </div>

  <div id="content-body">
    <p>
      Whoops! The URL specified routes to this help page.
    </p>
    <p>
      For more information about Selenium <span class="se-type"></span> please see the
      <a class="se-docs">docs</a> and/or visit the <a class="se-wiki">wiki</a>.
      <span id="console-item">
        Or perhaps you are looking for the Selenium <span class="se-type"></span> <a class="se-console">console</a>.
      </span>
    </p>
    <p>
      Happy Testing!
    </p>
  </div>

  <div>
    <footer id="help-footer">
      Selenium is made possible through the efforts of our open source community, contributions from
      these <a href="https://github.com/SeleniumHQ/selenium/blob/master/AUTHORS">people</a>, and our
      <a href="http://www.seleniumhq.org/sponsors/">sponsors</a>.
   </footer>
  </div>
 </div>

</body>
</html>
    at getErrorFromResponseBody (C:\Users\amrka\Desktop\wdExample\node_modules\webdriver\build\utils.js:114:12)
    at WebDriverRequest._request (C:\Users\amrka\Desktop\wdExample\node_modules\webdriver\build\request.js:149:56)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async startWebDriverSession (C:\Users\amrka\Desktop\wdExample\node_modules\webdriver\build\utils.js:41:16)
    at async Function.newSession (C:\Users\amrka\Desktop\wdExample\node_modules\webdriver\build\index.js:44:23)
    at async remote (C:\Users\amrka\Desktop\wdExample\node_modules\webdriverio\build\index.js:75:20)
    at async C:\Users\amrka\Desktop\wdExample\node_modules\webdriverio\build\index.js:104:22
    at async Promise.all (index 0)
    at async multiremote (C:\Users\amrka\Desktop\wdExample\node_modules\webdriverio\build\index.js:103:3)
    at async initialiseInstance (C:\Users\amrka\Desktop\wdExample\node_modules\@wdio\runner\build\utils.js:81:19)
2020-07-29T14:32:25.953Z ERROR @wdio/runner: Error: Failed to create session.
It seems you are running a Selenium Standalone server and point to a wrong path. Please set `path: '/wd/hub'` in your wdio.conf.js!
    at startWebDriverSession (C:\Users\amrka\Desktop\wdExample\node_modules\webdriver\build\utils.js:45:11)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
2020-07-29T14:32:25.960Z WARN webdriver: Request failed with status 404 due to The URL '/wd/hub/session' did not map to a valid resource
[0-0]  Error:  Failed to create session.
It seems you are running a Selenium Standalone server and point to a wrong path. Please set `path: '/wd/hub'` in your wdio.conf.js!
[0-0] 2020-07-29T14:32:25.953Z DEBUG webdriver: request failed due to missing body
2020-07-29T14:32:25.960Z DEBUG webdriver: request failed due to missing body
2020-07-29T14:32:25.961Z INFO webdriver: Retrying 1/3
2020-07-29T14:32:25.961Z INFO webdriver: [POST] http://localhost:4728/wd/hub/session
2020-07-29T14:32:25.961Z INFO webdriver: DATA {
  capabilities: {
    alwaysMatch: {
      platformName: 'Android',
      browserName: 'chrome',
      'appium:deviceName': 'pixel2',
      'appium:avd': 'pixel2',
      'appium:platformVersion': '10',
      'appium:avdLaunchTimeout': 120000,
      'appium:avdReadyTimeout': 120000,
      'appium:uiautomator2ServerInstallTimeout': 120000,
      'appium:appWaitForLaunch': true,
      'appium:ensureWebviewsHavePages': true,
      'appium:disableWindowAnimation': true,
      'appium:autoGrantPermissions': true,
      'appium:clearSystemFiles': true,
      'appium:nativeWebScreenshot': true
    },
    firstMatch: [ {} ]
  },
  desiredCapabilities: {
    platformName: 'Android',
    browserName: 'chrome',
    'appium:deviceName': 'pixel2',
    'appium:avd': 'pixel2',
    'appium:platformVersion': '10',
    'appium:avdLaunchTimeout': 120000,
    'appium:avdReadyTimeout': 120000,
    'appium:uiautomator2ServerInstallTimeout': 120000,
    'appium:appWaitForLaunch': true,
    'appium:ensureWebviewsHavePages': true,
    'appium:disableWindowAnimation': true,
    'appium:autoGrantPermissions': true,
    'appium:clearSystemFiles': true,
    'appium:nativeWebScreenshot': true
  }
}
2020-07-29T14:32:25.966Z DEBUG webdriver: request failed due to missing body
2020-07-29T14:32:25.967Z INFO webdriver: Retrying 2/3
2020-07-29T14:32:25.967Z INFO webdriver: [POST] http://localhost:4728/wd/hub/session
2020-07-29T14:32:25.967Z INFO webdriver: DATA {
  capabilities: {
    alwaysMatch: {
      platformName: 'Android',
      browserName: 'chrome',
      'appium:deviceName': 'pixel2',
      'appium:avd': 'pixel2',
      'appium:platformVersion': '10',
      'appium:avdLaunchTimeout': 120000,
      'appium:avdReadyTimeout': 120000,
      'appium:uiautomator2ServerInstallTimeout': 120000,
      'appium:appWaitForLaunch': true,
      'appium:ensureWebviewsHavePages': true,
      'appium:disableWindowAnimation': true,
      'appium:autoGrantPermissions': true,
      'appium:clearSystemFiles': true,
      'appium:nativeWebScreenshot': true
    },
    firstMatch: [ {} ]
  },
  desiredCapabilities: {
    platformName: 'Android',
    browserName: 'chrome',
    'appium:deviceName': 'pixel2',
    'appium:avd': 'pixel2',
    'appium:platformVersion': '10',
    'appium:avdLaunchTimeout': 120000,
    'appium:avdReadyTimeout': 120000,
    'appium:uiautomator2ServerInstallTimeout': 120000,
    'appium:appWaitForLaunch': true,
    'appium:ensureWebviewsHavePages': true,
    'appium:disableWindowAnimation': true,
    'appium:autoGrantPermissions': true,
    'appium:clearSystemFiles': true,
    'appium:nativeWebScreenshot': true
  }
}
2020-07-29T14:32:25.971Z DEBUG webdriver: request failed due to missing body
2020-07-29T14:32:25.971Z INFO webdriver: Retrying 3/3
2020-07-29T14:32:25.971Z INFO webdriver: [POST] http://localhost:4728/wd/hub/session
2020-07-29T14:32:25.971Z INFO webdriver: DATA {
  capabilities: {
    alwaysMatch: {
      platformName: 'Android',
      browserName: 'chrome',
      'appium:deviceName': 'pixel2',
      'appium:avd': 'pixel2',
      'appium:platformVersion': '10',
      'appium:avdLaunchTimeout': 120000,
      'appium:avdReadyTimeout': 120000,
      'appium:uiautomator2ServerInstallTimeout': 120000,
      'appium:appWaitForLaunch': true,
      'appium:ensureWebviewsHavePages': true,
      'appium:disableWindowAnimation': true,
      'appium:autoGrantPermissions': true,
      'appium:clearSystemFiles': true,
      'appium:nativeWebScreenshot': true
    },
    firstMatch: [ {} ]
  },
  desiredCapabilities: {
    platformName: 'Android',
    browserName: 'chrome',
    'appium:deviceName': 'pixel2',
    'appium:avd': 'pixel2',
    'appium:platformVersion': '10',
    'appium:avdLaunchTimeout': 120000,
    'appium:avdReadyTimeout': 120000,
    'appium:uiautomator2ServerInstallTimeout': 120000,
    'appium:appWaitForLaunch': true,
    'appium:ensureWebviewsHavePages': true,
    'appium:disableWindowAnimation': true,
    'appium:autoGrantPermissions': true,
    'appium:clearSystemFiles': true,
    'appium:nativeWebScreenshot': true
  }
}
2020-07-29T14:32:25.976Z DEBUG webdriver: request failed due to missing body
[0-0] 2020-07-29T14:32:25.967Z WARN webdriver: Request failed with status 404 due to The URL '/wd/hub/session' did not map to a valid resource
2020-07-29T14:32:25.971Z WARN webdriver: Request failed with status 404 due to The URL '/wd/hub/session' did not map to a valid resource
2020-07-29T14:32:25.976Z ERROR webdriver: Request failed with status 404 due to Error: The URL '/wd/hub/session' did not map to a valid resource
2020-07-29T14:32:25.976Z ERROR webdriver: Error: The URL '/wd/hub/session' did not map to a valid resource
    at getErrorFromResponseBody (C:\Users\amrka\Desktop\wdExample\node_modules\webdriver\build\utils.js:114:12)
    at WebDriverRequest._request (C:\Users\amrka\Desktop\wdExample\node_modules\webdriver\build\request.js:149:56)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async startWebDriverSession (C:\Users\amrka\Desktop\wdExample\node_modules\webdriver\build\utils.js:41:16)
    at async Function.newSession (C:\Users\amrka\Desktop\wdExample\node_modules\webdriver\build\index.js:44:23)
    at async remote (C:\Users\amrka\Desktop\wdExample\node_modules\webdriverio\build\index.js:75:20)
    at async C:\Users\amrka\Desktop\wdExample\node_modules\webdriverio\build\index.js:104:22
    at async Promise.all (index 1)
2020-07-29T14:32:26.082Z DEBUG @wdio/local-runner: Runner 0-0 finished with exit code 1
[0-0] FAILED in MultiRemote - C:\Users\amrka\Desktop\wdExample\test\specs\test.spec.js
2020-07-29T14:32:26.083Z INFO @wdio/cli:launcher: Run onComplete hook
2020-07-29T14:32:26.084Z INFO @wdio/selenium-standalone-service: shutting down all browsers
2020-07-29T14:32:26.085Z DEBUG @wdio/appium-service: Appium (pid: 7676) killed

Spec Files:      0 passed, 1 failed, 1 total (100% completed) in 00:00:03`

@christian-bromann
Copy link
Member

sorry, updated:

exports.config = {
  specs: ['./test/specs/*.spec.js'],

  capabilities: {
    myChromeBrowser: {
      port: 4444,
      path: '/wd/hub'
      capabilities: {
        browserName: 'chrome',
        path: '/wd/hub'
      }
    },
    androidClient: {
      port: 4728,
      path: '/'
      capabilities: {
        path: '/'
        platformName: 'Android',
        browserName: 'chrome',
        'appium:deviceName': 'pixel2',
        'appium:avd': 'pixel2',
        'appium:platformVersion': '10',
        'appium:avdLaunchTimeout': 120000,
        'appium:avdReadyTimeout': 120000,
        'appium:uiautomator2ServerInstallTimeout' :120000,
        'appium:appWaitForLaunch': true,
        'appium:ensureWebviewsHavePages': true,
        'appium:disableWindowAnimation': true,
        'appium:autoGrantPermissions': true,
        'appium:clearSystemFiles': true,
        'appium:nativeWebScreenshot': true
      }
    }
  },
  // ...
}

@amrsa1
Copy link
Contributor Author

amrsa1 commented Jul 29, 2020

@christian-bromann

same :(

Execution of 1 spec files started at 2020-07-29T14:37:21.501Z

2020-07-29T14:37:21.504Z DEBUG @wdio/utils:initialiseServices: initialise service "selenium-standalone" as NPM package
2020-07-29T14:37:21.508Z DEBUG @wdio/utils:initialiseServices: initialise service "appium" as NPM package
2020-07-29T14:37:21.509Z INFO @wdio/cli:launcher: Run onPrepare hook
2020-07-29T14:37:21.516Z DEBUG @wdio/appium-service: Will spawn Appium process: cmd /c appium --base-path / --debug-log-spacing --session-override --port 4728
2020-07-29T14:37:23.176Z DEBUG @wdio/appium-service: Appium started with ID: 13176
2020-07-29T14:37:23.471Z INFO @wdio/cli:launcher: Run onWorkerStart hook
2020-07-29T14:37:23.475Z INFO @wdio/local-runner: Start worker 0-0 with arg: wdio.conf.js
[0-0] 2020-07-29T14:37:24.017Z INFO @wdio/local-runner: Run worker command: run
[0-0] 2020-07-29T14:37:24.874Z DEBUG @wdio/local-runner:utils: init multiremote session
[0-0] 2020-07-29T14:37:24.877Z INFO webdriverio: Initiate new session using the ./protocol-stub protocol
[0-0] 2020-07-29T14:37:24.878Z INFO webdriverio: Initiate new session using the ./protocol-stub protocol
[0-0] RUNNING in MultiRemote - C:\Users\amrka\Desktop\wdExample\test\specs\test.spec.js
[0-0] 2020-07-29T14:37:24.904Z DEBUG @wdio/utils:initialiseServices: initialise service "selenium-standalone" as NPM package
2020-07-29T14:37:24.905Z DEBUG @wdio/utils:initialiseServices: initialise service "appium" as NPM package
[0-0] 2020-07-29T14:37:24.906Z DEBUG @wdio/local-runner:utils: init multiremote session
[0-0] 2020-07-29T14:37:24.907Z INFO webdriverio: Initiate new session using the webdriver protocol
2020-07-29T14:37:24.907Z INFO webdriverio: Initiate new session using the webdriver protocol
[0-0] 2020-07-29T14:37:24.908Z INFO webdriver: [POST] http://localhost:4444/session
[0-0] 2020-07-29T14:37:24.908Z INFO webdriver: DATA {
  capabilities: {
    alwaysMatch: { browserName: 'chrome', path: '/wd/hub' },
    firstMatch: [ {} ]
  },
  desiredCapabilities: { browserName: 'chrome', path: '/wd/hub' }
}
[0-0] 2020-07-29T14:37:24.919Z INFO webdriver: [POST] http://localhost:4728/session
2020-07-29T14:37:24.920Z INFO webdriver: DATA {
  capabilities: {
    alwaysMatch: {
      platformName: 'Android',
      browserName: 'chrome',
      'appium:deviceName': 'pixel2',
      'appium:avd': 'pixel2',
      'appium:platformVersion': '10',
      'appium:avdLaunchTimeout': 120000,
      'appium:avdReadyTimeout': 120000,
      'appium:uiautomator2ServerInstallTimeout': 120000,
      'appium:appWaitForLaunch': true,
      'appium:ensureWebviewsHavePages': true,
      'appium:disableWindowAnimation': true,
      'appium:autoGrantPermissions': true,
      'appium:clearSystemFiles': true,
      'appium:nativeWebScreenshot': true
    },
    firstMatch: [ {} ]
  },
  desiredCapabilities: {
    platformName: 'Android',
    browserName: 'chrome',
    'appium:deviceName': 'pixel2',
    'appium:avd': 'pixel2',
    'appium:platformVersion': '10',
    'appium:avdLaunchTimeout': 120000,
    'appium:avdReadyTimeout': 120000,
    'appium:uiautomator2ServerInstallTimeout': 120000,
    'appium:appWaitForLaunch': true,
    'appium:ensureWebviewsHavePages': true,
    'appium:disableWindowAnimation': true,
    'appium:autoGrantPermissions': true,
    'appium:clearSystemFiles': true,
    'appium:nativeWebScreenshot': true
  }
}
[0-0] 2020-07-29T14:37:24.963Z DEBUG webdriver: request failed due to missing body
[0-0] 2020-07-29T14:37:24.963Z ERROR webdriver: Request failed with status 404 due to Error: <!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <link rel="stylesheet" type="text/css" href="/assets/displayhelpservlet.css" media="all"/>
  <link href="/assets/favicon.ico" rel="icon" type="image/x-icon" />
  <script src="/assets/jquery-3.1.1.min.js" type="text/javascript"></script>
  <script src="/assets/displayhelpservlet.js" type="text/javascript"></script>
  <script type="text/javascript">
    var json = Object.freeze('{"consoleLink": "\u002fwd\u002fhub","type": "Standalone","class": "org.openqa.grid.web.servlet.DisplayHelpHandler$DisplayHelpServletConfig","version": "3.141.59"}');
  </script>
</head>
<body>

<div id="content">
  <div id="help-heading">
    <h1><span id="logo"></span></h1>
    <h2>Selenium <span class="se-type"></span>&nbsp;v.<span class="se-version"></span></h2>
  </div>

  <div id="content-body">
    <p>
      Whoops! The URL specified routes to this help page.
    </p>
    <p>
      For more information about Selenium <span class="se-type"></span> please see the
      <a class="se-docs">docs</a> and/or visit the <a class="se-wiki">wiki</a>.
      <span id="console-item">
        Or perhaps you are looking for the Selenium <span class="se-type"></span> <a class="se-console">console</a>.
      </span>
    </p>
    <p>
      Happy Testing!
    </p>
  </div>

  <div>
    <footer id="help-footer">
      Selenium is made possible through the efforts of our open source community, contributions from
      these <a href="https://github.com/SeleniumHQ/selenium/blob/master/AUTHORS">people</a>, and our
      <a href="http://www.seleniumhq.org/sponsors/">sponsors</a>.
   </footer>
  </div>
 </div>

</body>
</html>
2020-07-29T14:37:24.963Z ERROR webdriver: Error: <!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <link rel="stylesheet" type="text/css" href="/assets/displayhelpservlet.css" media="all"/>
  <link href="/assets/favicon.ico" rel="icon" type="image/x-icon" />
  <script src="/assets/jquery-3.1.1.min.js" type="text/javascript"></script>
  <script src="/assets/displayhelpservlet.js" type="text/javascript"></script>
  <script type="text/javascript">
    var json = Object.freeze('{"consoleLink": "\u002fwd\u002fhub","type": "Standalone","class": "org.openqa.grid.web.servlet.DisplayHelpHandler$DisplayHelpServletConfig","version": "3.141.59"}');
  </script>
</head>
<body>

<div id="content">
  <div id="help-heading">
    <h1><span id="logo"></span></h1>
    <h2>Selenium <span class="se-type"></span>&nbsp;v.<span class="se-version"></span></h2>
  </div>

  <div id="content-body">
    <p>
      Whoops! The URL specified routes to this help page.
    </p>
    <p>
      For more information about Selenium <span class="se-type"></span> please see the
      <a class="se-docs">docs</a> and/or visit the <a class="se-wiki">wiki</a>.
      <span id="console-item">
        Or perhaps you are looking for the Selenium <span class="se-type"></span> <a class="se-console">console</a>.
      </span>
    </p>
    <p>
      Happy Testing!
    </p>
  </div>

  <div>
    <footer id="help-footer">
      Selenium is made possible through the efforts of our open source community, contributions from
      these <a href="https://github.com/SeleniumHQ/selenium/blob/master/AUTHORS">people</a>, and our
      <a href="http://www.seleniumhq.org/sponsors/">sponsors</a>.
   </footer>
  </div>
 </div>

</body>
</html>
    at getErrorFromResponseBody (C:\Users\amrka\Desktop\wdExample\node_modules\webdriver\build\utils.js:114:12)
    at WebDriverRequest._request (C:\Users\amrka\Desktop\wdExample\node_modules\webdriver\build\request.js:149:56)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async startWebDriverSession (C:\Users\amrka\Desktop\wdExample\node_modules\webdriver\build\utils.js:41:16)
    at async Function.newSession (C:\Users\amrka\Desktop\wdExample\node_modules\webdriver\build\index.js:44:23)
    at async remote (C:\Users\amrka\Desktop\wdExample\node_modules\webdriverio\build\index.js:75:20)
    at async C:\Users\amrka\Desktop\wdExample\node_modules\webdriverio\build\index.js:104:22
    at async Promise.all (index 0)
    at async multiremote (C:\Users\amrka\Desktop\wdExample\node_modules\webdriverio\build\index.js:103:3)
    at async initialiseInstance (C:\Users\amrka\Desktop\wdExample\node_modules\@wdio\runner\build\utils.js:81:19)
[0-0]  Error:  Failed to create session.
It seems you are running a Selenium Standalone server and point to a wrong path. Please set `path: '/wd/hub'` in your wdio.conf.js!
[0-0] 2020-07-29T14:37:24.963Z ERROR @wdio/runner: Error: Failed to create session.
It seems you are running a Selenium Standalone server and point to a wrong path. Please set `path: '/wd/hub'` in your wdio.conf.js!
    at startWebDriverSession (C:\Users\amrka\Desktop\wdExample\node_modules\webdriver\build\utils.js:45:11)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
2020-07-29T14:37:25.079Z DEBUG @wdio/local-runner: Runner 0-0 finished with exit code 1
[0-0] FAILED in MultiRemote - C:\Users\amrka\Desktop\wdExample\test\specs\test.spec.js
2020-07-29T14:37:25.081Z INFO @wdio/cli:launcher: Run onComplete hook
2020-07-29T14:37:25.081Z INFO @wdio/selenium-standalone-service: shutting down all browsers
2020-07-29T14:37:25.089Z DEBUG @wdio/appium-service: Appium (pid: 18268) killed

Spec Files:      0 passed, 1 failed, 1 total (100% completed) in 00:00:03

@amrsa1
Copy link
Contributor Author

amrsa1 commented Jul 30, 2020

@christian-bromann
is there anything else i should try?

@amrsa1
Copy link
Contributor Author

amrsa1 commented Aug 8, 2020

Guys this ticket has been closed, however all provided solutions above gave same error

@christian-bromann
Copy link
Member

@amrkamel1 any help on this would be appreciated!

@hieuxlu
Copy link
Member

hieuxlu commented Aug 15, 2020

@amrkamel1 I think you should not mix 2 services in the same wdio.conf.js. So I would advise against the code below

services: [
  ['selenium-standalone', {
      args: {
        seleniumArgs: ['-port', '4444']
      },
  }],  
  ['appium',{
    command : 'appium',
    args: {
        debugLogSpacing: true,
        sessionOverride: true,
        port: 4723,
        
    },
    // args: ['-p','4722', '--relaxed-security', '--log-level', 'info:info']
  }]
],

What we normally do is either of below approaches:

  • Use different wdio.conf.js for each service
  • Use a base wdio.conf.js and switch service dynamically using environment variable or CLI argument

@amrsa1
Copy link
Contributor Author

amrsa1 commented Aug 15, 2020

@amrkamel1 I think you should not mix 2 services in the same wdio.conf.js. So I would advise against the code below

services: [
  ['selenium-standalone', {
      args: {
        seleniumArgs: ['-port', '4444']
      },
  }],  
  ['appium',{
    command : 'appium',
    args: {
        debugLogSpacing: true,
        sessionOverride: true,
        port: 4723,
        
    },
    // args: ['-p','4722', '--relaxed-security', '--log-level', 'info:info']
  }]
],

What we normally do is either of below approaches:

  • Use different wdio.conf.js for each service
  • Use a base wdio.conf.js and switch service dynamically using environment variable or CLI argument

Can you elaborate more how i can dynamically switch between service in same spec file

Since i have spend alot of time didnt find proper info for this case

Lets say have to conf.js file one for appium to launch mobile app and another conf.js for selenium service

So how i can make simple test case that have two method first one will click on an element in browser and 2nd method will click on an elememt on mobile app within same it block

@hieuxlu
Copy link
Member

hieuxlu commented Aug 15, 2020

That feels wrong, I'm pretty sure wdio and Selenium/Appium would not support such use case. There's a reason we run test for each capabilities, so how could you even start two capabilities at once for one test?

I think what you're trying to do is to create a side effect on the browser that is necessary for the subsequent action on the mobile app. In such case, we should just provision the side effect in before hook using API call, instead of launch the browser to do something that will affect the mobile app.

I haven't seen the use case you mentioned so correct me if I'm wrong, and please detail why you need to mix browser and app inside a single test case?

@amrsa1
Copy link
Contributor Author

amrsa1 commented Aug 15, 2020

That feels wrong, I'm pretty sure wdio and Selenium/Appium would not support such use case. There's a reason we run test for each capabilities, so how could you even start two capabilities at once for one test?

I think what you're trying to do is to create a side effect on the browser that is necessary for the subsequent action on the mobile app. In such case, we should just provision the side effect in before hook using API call, instead of launch the browser to do something that will affect the mobile app.

I haven't seen the use case you mentioned so correct me if I'm wrong, and please detail why you need to mix browser and app inside a single test case?

Definetly thats make sense

But for example when u are usinh java with TestNg you can manipulate the caps and terminate the driver and inititate another one in the testng hooks this leverage ur testing effort

For example u do some action on mobile app and you want to confirm that changes reflect on the web app, im able to manage this using testng framework with java

But since i recently start to use wdio so im try to demonstare all features and tricks that i was able to perform it using testng

Also i have one use case that was using in my current project that i should open chrome browser in mobile device and navigate to playstore web app then search by app package for specific app then download it

After that inititate the downloaded app by terminating the first session and initiate the 2nd one with the app capabilities.

My point is this kind of felixibility give good credit for the tool since there are actual cases that u need to use web app and mobile app as well

@hieuxlu
Copy link
Member

hieuxlu commented Aug 15, 2020

I think you're mixing browser automation which can be easily done by puppeteer, and wdio, which is a full fledged JavaScript e2e test framework. We don't use test framework for automation tasks. So do you agree that we should close this issue because it's not smth wdio support and not a bug of wdio?

@amrsa1
Copy link
Contributor Author

amrsa1 commented Aug 15, 2020

I think you're mixing browser automation which can be easily done by puppeteer, and wdio, which is a full fledged JavaScript e2e test framework. We don't use test framework for automation tasks. So do you agree that we should close this issue because it's not smth wdio support and not a bug of wdio?

To be more precise im mixing desktop browser with mobile or chrome browser in mobile app with mobile app

If this feature is not supported and no plan to be supported in future, then i think you should close it

@hieuxlu
Copy link
Member

hieuxlu commented Aug 15, 2020

I'm sure that selenium-standalone has nothing to do with browser inside an app or emulator, it works only with browser drivers on PCs and Macs. I'm not the topic owner, nor core maintainer so I can't close the issue, but I think this is not a bug or even a feature request, it's just not the way selenium-standalone works IMHO.
https://www.selenium.dev/downloads/

@amrsa1
Copy link
Contributor Author

amrsa1 commented Aug 17, 2020

I'm sure that selenium-standalone has nothing to do with browser inside an app or emulator, it works only with browser drivers on PCs and Macs. I'm not the topic owner, nor core maintainer so I can't close the issue, but I think this is not a bug or even a feature request, it's just not the way selenium-standalone works IMHO.
https://www.selenium.dev/downloads/

maybe its not bug but its a drawback since, it doesn't support cross service testing specially with mobile app since most of mobile app are linked to web app and cross verification is required this can be done by selenium and java client with testng framework but seems not supported by wdio

maybe it would be nice if there is way to override the caps in wdio config but automatically terminate the driver and initiate new one with the desired caps within the spec file

@christian-bromann christian-bromann removed first-timers-only Issues that are well described and directed for people that start contributing to the project good first pick a reasonable task to start getting familiar with the code base labels Aug 27, 2020
@christian-bromann
Copy link
Member

I think it is a bug. WebdriverIO should allow you to run browser tests and mobile tests in one suite at the same time. Let's say you want to run web tests on desktop and mobile, you would need Appium and Selenium Standalone to have the right drivers setup.

@christian-bromann
Copy link
Member

I tried with following setup:

    capabilities: [{
        port: 4446,
        browserName: 'chrome',
        acceptInsecureCerts: true
    }, {
        port: 4445,
        browserName: 'firefox',
        acceptInsecureCerts: true
    }],
    services: [
        ['chromedriver', {
            port: 4446
        }],
        ['selenium-standalone', {
            args: {
                seleniumArgs: ['-port', '4445']
            },
        }]
    ],

and saw both browser starting with the right drivers:

2020-08-27T13:31:30.743Z INFO webdriver: [POST] http://localhost:4446/session
2020-08-27T13:31:30.743Z INFO webdriver: DATA {
  capabilities: {
    alwaysMatch: { browserName: 'chrome', acceptInsecureCerts: true },
    firstMatch: [ {} ]
  },
  desiredCapabilities: { browserName: 'chrome', acceptInsecureCerts: true }
}
...
2020-08-27T13:31:30.748Z INFO webdriver: [POST] http://localhost:4445/wd/hub/session
2020-08-27T13:31:30.748Z INFO webdriver: DATA {
  capabilities: {
    alwaysMatch: {
      browserName: 'firefox',
      acceptInsecureCerts: true,
      'moz:firefoxOptions': [Object]
    },
    firstMatch: [ {} ]
  },
  desiredCapabilities: {
    browserName: 'firefox',
    acceptInsecureCerts: true,
    'moz:firefoxOptions': { args: [Array] }
  }
}

@christian-bromann
Copy link
Member

so I checked with wdio-chromedriver-service and @wdio/selenium-standalone-service and this combination in multiremote works:

    capabilities: {
        myChromeBrowser: {
            port: 4446,
            path: '/',
            capabilities: {
                browserName: 'chrome',
                acceptInsecureCerts: true
            }
        },
        myFFBrowser: {
            port: 4445,
            capabilities: {
                browserName: 'firefox',
                acceptInsecureCerts: true
            }
        }
    },
    services: [
        ['chromedriver', {
            port: 4446
        }],
        ['selenium-standalone', {
            args: {
                seleniumArgs: ['-port', '4445']
            },
        }]
    ],

@amrkamel1 my hunch is that we don't properly update the multiremote capabilities in the Appium service. Could you help and tweak that area in the node_modules to see which change needs to be applied?

@amrsa1
Copy link
Contributor Author

amrsa1 commented Aug 27, 2020

@christian-bromann
Okay i will try that i get back to u

@christian-bromann
Copy link
Member

The test show a correct behavior.

@christian-bromann christian-bromann added the Needs Investigation Issues that require more information on the problem. label Aug 27, 2020
@amrsa1
Copy link
Contributor Author

amrsa1 commented Aug 27, 2020

The test show a correct behavior.

That sounds great, i will try this caps that you have posted and let you know once i return back from vacation (next week) since i dont have access for any laptop now

@christian-bromann
Copy link
Member

Enjoy your vacation!

@amrsa1
Copy link
Contributor Author

amrsa1 commented Sep 1, 2020

@christian-bromann

i have tried the following, and still didnt manage to get it work

capabilities: {
    myChromeBrowser: {
      port: 4446,
      path: '/',
      capabilities: {
          browserName: 'chrome',
          acceptInsecureCerts: true
      }
    },
    androidClient: {
      port: 4728,
      path: '/',
      capabilities: {
        platformName: 'Android',
        browserName: 'chrome',
        'appium:deviceName': 'pixel2',
        'appium:avd': 'pixel2',
        'appium:platformVersion': '10',
        'appium:avdLaunchTimeout': 120000,
        'appium:avdReadyTimeout': 120000,
        'appium:uiautomator2ServerInstallTimeout' :120000,
        'appium:appWaitForLaunch': true,
        'appium:ensureWebviewsHavePages': true,
        'appium:disableWindowAnimation': true,
        'appium:autoGrantPermissions': true,
        'appium:clearSystemFiles': true,
        'appium:nativeWebScreenshot': true,
          }
  }
},

services: [
  ['selenium-standalone', {
      args: {
        seleniumArgs: ['-port', '4444']
      },
  }],  
  ['appium',{
    command : 'appium',
    args: {
        debugLogSpacing: true,
        sessionOverride: true,
        port: 4728,
    },
  }]
]
```,


       `Execution of 1 spec files started at 2020-09-01T09:15:50.455Z

2020-09-01T09:15:50.458Z DEBUG @wdio/utils:initialiseServices: initialise service "selenium-standalone" as NPM package
2020-09-01T09:15:50.465Z DEBUG @wdio/utils:initialiseServices: initialise service "appium" as NPM package
2020-09-01T09:15:50.468Z INFO @wdio/cli:launcher: Run onPrepare hook
2020-09-01T09:15:50.478Z DEBUG @wdio/appium-service: Will spawn Appium process: cmd /c appium --base-path / --debug-log-spacing --session-override --port 4728
2020-09-01T09:15:51.798Z DEBUG @wdio/appium-service: Appium started with ID: 22764
2020-09-01T09:15:52.755Z INFO @wdio/cli:launcher: Run onWorkerStart hook
2020-09-01T09:15:52.760Z INFO @wdio/local-runner: Start worker 0-0 with arg: wdio.conf.js
[0-0] 2020-09-01T09:15:53.323Z INFO @wdio/local-runner: Run worker command: run
[0-0] 2020-09-01T09:15:54.215Z DEBUG @wdio/local-runner:utils: init multiremote session
[0-0] 2020-09-01T09:15:54.218Z INFO webdriverio: Initiate new session using the ./protocol-stub protocol
[0-0] 2020-09-01T09:15:54.218Z INFO webdriverio: Initiate new session using the ./protocol-stub protocol
[0-0] RUNNING in MultiRemote - C:\Users\amrka\Desktop\wdExample\test\specs\test.spec.js
[0-0] 2020-09-01T09:15:54.246Z DEBUG @wdio/utils:initialiseServices: initialise service "selenium-standalone" as NPM package
2020-09-01T09:15:54.247Z DEBUG @wdio/utils:initialiseServices: initialise service "appium" as NPM package
[0-0] 2020-09-01T09:15:54.248Z DEBUG @wdio/local-runner:utils: init multiremote session
[0-0] 2020-09-01T09:15:54.248Z INFO webdriverio: Initiate new session using the webdriver protocol
2020-09-01T09:15:54.249Z INFO webdriverio: Initiate new session using the webdriver protocol
[0-0] 2020-09-01T09:15:54.251Z INFO webdriver: [POST] http://localhost:4446/session
[0-0] 2020-09-01T09:15:54.251Z INFO webdriver: DATA {
  capabilities: {
    alwaysMatch: { browserName: 'chrome', acceptInsecureCerts: true },
    firstMatch: [ {} ]
  },
  desiredCapabilities: { browserName: 'chrome', acceptInsecureCerts: true }
}
2020-09-01T09:15:54.257Z INFO webdriver: [POST] http://localhost:4728/session
2020-09-01T09:15:54.257Z INFO webdriver: DATA {
  capabilities: {
    alwaysMatch: {
      platformName: 'Android',
      browserName: 'chrome',
      'appium:deviceName': 'pixel2',
      'appium:avd': 'pixel2',
      'appium:platformVersion': '10',
      'appium:avdLaunchTimeout': 120000,
      'appium:avdReadyTimeout': 120000,
      'appium:uiautomator2ServerInstallTimeout': 120000,
      'appium:appWaitForLaunch': true,
      'appium:ensureWebviewsHavePages': true,
      'appium:disableWindowAnimation': true,
      'appium:autoGrantPermissions': true,
      'appium:clearSystemFiles': true,
      'appium:nativeWebScreenshot': true
    },
    firstMatch: [ {} ]
  },
  desiredCapabilities: {
    platformName: 'Android',
    browserName: 'chrome',
    'appium:deviceName': 'pixel2',
    'appium:avd': 'pixel2',
    'appium:platformVersion': '10',
    'appium:avdLaunchTimeout': 120000,
    'appium:avdReadyTimeout': 120000,
    'appium:uiautomator2ServerInstallTimeout': 120000,
    'appium:appWaitForLaunch': true,
    'appium:ensureWebviewsHavePages': true,
    'appium:disableWindowAnimation': true,
    'appium:autoGrantPermissions': true,
    'appium:clearSystemFiles': true,
    'appium:nativeWebScreenshot': true
  }
}
[0-0] 2020-09-01T09:15:56.299Z ERROR webdriver: RequestError: connect ECONNREFUSED 127.0.0.1:4446
    at ClientRequest.<anonymous> (C:\Users\amrka\Desktop\wdExample\node_modules\got\dist\source\core\index.js:890:25)
    at Object.onceWrapper (events.js:422:26)
    at ClientRequest.emit (events.js:327:22)
    at ClientRequest.EventEmitter.emit (domain.js:482:12)
    at ClientRequest.origin.emit (C:\Users\amrka\Desktop\wdExample\node_modules\@szmarczak\http-timer\dist\source\index.js:39:20)
    at Socket.socketErrorListener (_http_client.js:426:9)
    at Socket.emit (events.js:315:20)
    at Socket.EventEmitter.emit (domain.js:482:12)
    at emitErrorNT (internal/streams/destroy.js:92:8)
    at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16)
[0-0]  Error:  Failed to create session.
Unable to connect to "http://localhost:4446/", make sure browser driver is running on that address.
If you use services like chromedriver see initialiseServices logs above or in wdio.log file as the service might had problems to start the driver.
[0-0] 2020-09-01T09:15:56.300Z ERROR @wdio/runner: Error: Failed to create session.
Unable to connect to "http://localhost:4446/", make sure browser driver is running on that address.
If you use services like chromedriver see initialiseServices logs above or in wdio.log file as the service might had problems to start the driver.
    at startWebDriverSession (C:\Users\amrka\Desktop\wdExample\node_modules\webdriver\build\utils.js:45:11)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
2020-09-01T09:15:56.414Z DEBUG @wdio/local-runner: Runner 0-0 finished with exit code 1
[0-0] FAILED in MultiRemote - C:\Users\amrka\Desktop\wdExample\test\specs\test.spec.js
2020-09-01T09:15:56.416Z INFO @wdio/cli:launcher: Run onComplete hook
2020-09-01T09:15:56.417Z INFO @wdio/selenium-standalone-service: shutting down all browsers
2020-09-01T09:15:56.418Z DEBUG @wdio/appium-service: Appium (pid: 11524) killed`

@amrsa1
Copy link
Contributor Author

amrsa1 commented Sep 2, 2020

@christian-bromann

Good news!! :D
its working now with config below.

`  capabilities: {
myChromeBrowser: {
  port: 4444,
  path: '/wd/hub',
  capabilities: {
      browserName: 'chrome',
      acceptInsecureCerts: true
  }
},
androidClient: {
  port: 4728,
  path: '/',
  capabilities: {
    platformName: 'Android',
    browserName: 'chrome',
    'appium:deviceName': 'pixel2',
    'appium:avd': 'pixel2',
    'appium:platformVersion': '10',
    'appium:avdLaunchTimeout': 120000,
    'appium:avdReadyTimeout': 120000,
    'appium:uiautomator2ServerInstallTimeout' :120000,
    'appium:appWaitForLaunch': true,
    'appium:ensureWebviewsHavePages': true,
    'appium:disableWindowAnimation': true,
    'appium:autoGrantPermissions': true,
    'appium:clearSystemFiles': true,
    'appium:nativeWebScreenshot': true,
  }
  }
       },
        services: [
      ['selenium-standalone', {
         args: {
           seleniumArgs: ['-port', '4444']
         },
     }],  
     ['appium',{
       command : 'appium',
       args: {
           debugLogSpacing: true,
           sessionOverride: true,
           port: 4728,
       },
     }]
   ],`

note:
I have upgraded all the json package to latest

2020-09-02_10h19_18

@amrsa1
Copy link
Contributor Author

amrsa1 commented Sep 2, 2020

just one minor thing down blow in the screenshot its not shown the broswer type, i think maybe because we are combining two different browser within one spec

image

@christian-bromann
Copy link
Member

Yeah, this is a different story. Glad it works now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🐛 help wanted Issues that are free to take by anyone interested Needs Investigation Issues that require more information on the problem.
Projects
None yet
Development

No branches or pull requests

3 participants