question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

WebdriverIO in watch-mode "forgets" hostname and protocol if not explicitly specified

See original GitHub issue

Environment (please complete the following information):

  • WebdriverIO version: [7.1.0]
  • Mode: [WDIO Testrunner]
  • If WDIO Testrunner, running sync/async: [async]

Config of WebdriverIO

export const config: WebdriverIO.Config = {
    runner: "local",
    specs: ["__specs__/*.spec.js"],
    specFileRetries: 0,
    capabilities: [{browserName: "chrome", "goog:chromeOptions": {args: chrome_args}}],
    port: 9515,
    path: "/",

    services: [
        ["chromedriver", {logFileName: `${test_dir}/chromedriver.log`, port: 9515}],
    ],
}

Note: The bug happens with the default service as well.

Describe the bug WebdriverIO works fine until I try to use the watch mode. Then the first run is still ok but the consecutive ones fail with:

UnsupportedProtocolError: Unsupported protocol "undefined:"
    at normalizeArguments (/Users/pero/src/pero/cling-main/node_modules/got/dist/source/core/index.js:420:23)
    at normalizeArguments (/Users/pero/src/pero/cling-main/node_modules/got/dist/source/as-promise/core.js:34:31)
    at Object.got [as default] (/Users/pero/src/pero/cling-main/node_modules/got/dist/source/create.js:88:39)
    at WebDriverRequest._request (/Users/pero/src/pero/cling-main/node_modules/webdriver/build/request.js:126:41)
    at WebDriverRequest.makeRequest (/Users/pero/src/pero/cling-main/node_modules/webdriver/build/request.js:68:21)
    at Browser.protocolCommand (/Users/pero/src/pero/cling-main/node_modules/webdriver/build/command.js:74:24)
    at Browser.wrapCommandFn (/Users/pero/src/pero/cling-main/node_modules/@wdio/utils/build/shim.js:79:38)

It works once I explicitly configure hostname and protocol:

config = {
...
    hostname: "localhost",
    protocol: "http",
...
}

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
jbblanchetcommented, Apr 24, 2021

@christian-bromann just saw the tags you added. I don’t mind trying picking this up, but I just left on vacation for a week, and I have to onboard a new dev when I return, so it could be 10-15 days before I’m able to contribute.

1reaction
flunderperocommented, Mar 10, 2021

@jbblanchet Ah, sorry. I was in the middle of something else and just wanted to help out quickly. Great to hear that it worked in the end.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configuration - WebdriverIO
Protocol to use when communicating with the driver server. Type: String Default: http. hostname​. Host of your driver server. Type: String
Read more >
Configuration File - WebdriverIO
The configuration file contains all necessary information to run your test suite. It's a NodeJS module that exports a JSON. Here is an...
Read more >
WebDriver Protocol - WebdriverIO
newSession​. The New Session command creates a new WebDriver session with the endpoint node. If the creation fails, a session not created error...
Read more >
Auto-waiting - WebdriverIO
Explicit ​. The WebDriver protocol offers implicit timeouts that allow specify how long the driver is suppose to wait for an element to...
Read more >
TypeScript Setup - WebdriverIO
WebdriverIO will automatically detect if these dependencies are installed and will compile your config and tests for you. Ensure to have a tsconfig.json...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found