webdriverio / webdriverio

Next-gen browser and mobile automation test framework for Node.js
http://webdriver.io
MIT License
9.04k stars 2.5k forks source link

Unknown error happens with selenium standalone only on CI #8980

Closed Yurii397 closed 2 years ago

Yurii397 commented 2 years ago

Have you read the Contributing Guidelines on issues?

WebdriverIO Version

7.7.8

Node.js Version

12.22.0

Mode

Standalone Mode

Which capabilities are you using?

capabilities: [
    {
      maxInstances: 1,
      browserName: 'chrome',
      'goog:chromeOptions': {
        args: [
          '--headless',
          'window-size=1920,1080',
          '--disable-gpu',
          '--no-sandbox',
          '--disable-dev-shm-usage',
          '--disable-web-security',
          '--force-device-scale-factor=1',
        ],
        prefs: {
          directory_upgrade: true,
          prompt_for_download: false,
          'download.default_directory': downloadFolder,
        },
      },
    },
  ],

What happened?

I'm doing the migration from version WDIO v6 to v7, using the 'selenium-standalone' service. Locally tests run perfectly hover on CI 0 tests passed. haven't idea what can be wrong since can't reproduce it locally.

What is your expected behavior?

To have passed tests on CI the same as locally

How to reproduce the bug.

using these one's packages

 "@wdio/cli": "^7.7.8",
"@wdio/cucumber-framework": "^7.7.7",
"@wdio/local-runner": "^7.7.8",
"@wdio/selenium-standalone-service": "^7.7.5",
"@wdio/spec-reporter": "^7.7.7",
"@wdio/sync": "^7.7.6",
"@cucumber/cucumber": "^7.3.1",

Relevant log output

`2022-10-07T12:54:39.568Z WARN @wdio/utils:shim: You are running tests with @wdio/sync which will be discontinued starting Node.js v16.Read more on https://github.com/webdriverio/webdriverio/discussions/6702
2022-10-07T12:54:39.954Z INFO @wdio/local-runner: Run worker command: run
2022-10-07T12:54:40.144Z DEBUG @wdio/config:utils: Found 'ts-node' package, auto-compiling TypeScript files
2022-10-07T12:54:42.643Z DEBUG @wdio/local-runner:utils: init remote session
2022-10-07T12:54:42.658Z DEBUG @wdio/utils:initialiseServices: initialise service "selenium-standalone" as NPM package
2022-10-07T12:54:42.873Z DEBUG @wdio/utils:initialiseServices: initialise service "image-comparison" as NPM package
2022-10-07T12:54:42.978Z DEBUG @wdio/sync: Finished to run "beforeSession" hook in 0ms
2022-10-07T12:54:44.036Z DEBUG @wdio/local-runner:utils: init remote session
2022-10-07T12:54:44.037Z INFO webdriver: Initiate new session using the WebDriver protocol
2022-10-07T12:54:44.081Z INFO webdriver: [POST] http://localhost:4444/wd/hub/session
2022-10-07T12:54:44.081Z INFO webdriver: DATA {
  capabilities: {
    alwaysMatch: { browserName: 'chrome', 'goog:chromeOptions': [Object] },
    firstMatch: [ {} ]
  },
  desiredCapabilities: {
    browserName: 'chrome',
    'goog:chromeOptions': { args: [Array], prefs: {} }
  }
}
2022-10-07T12:54:44.100Z DEBUG webdriver: request failed due to response error: unknown error
2022-10-07T12:54:44.101Z WARN webdriver: Request failed with status 500 due to Context has not been changed
2022-10-07T12:54:44.101Z INFO webdriver: Retrying 1/3
2022-10-07T12:54:44.101Z INFO webdriver: [POST] http://localhost:4444/wd/hub/session
2022-10-07T12:54:44.101Z INFO webdriver: DATA {
  capabilities: {
    alwaysMatch: { browserName: 'chrome', 'goog:chromeOptions': [Object] },
    firstMatch: [ {} ]
  },
  desiredCapabilities: {
    browserName: 'chrome',
    'goog:chromeOptions': { args: [Array], prefs: {} }
  }
}
2022-10-07T12:54:44.106Z DEBUG webdriver: request failed due to response error: unknown error
2022-10-07T12:54:44.106Z WARN webdriver: Request failed with status 500 due to Context has not been changed
2022-10-07T12:54:44.106Z INFO webdriver: Retrying 2/3
2022-10-07T12:54:44.106Z INFO webdriver: [POST] http://localhost:4444/wd/hub/session
2022-10-07T12:54:44.106Z INFO webdriver: DATA {
  capabilities: {
    alwaysMatch: { browserName: 'chrome', 'goog:chromeOptions': [Object] },
    firstMatch: [ {} ]
  },
  desiredCapabilities: {
    browserName: 'chrome',
    'goog:chromeOptions': { args: [Array], prefs: {} }
  }
}
2022-10-07T12:54:44.110Z DEBUG webdriver: request failed due to response error: unknown error
2022-10-07T12:54:44.110Z WARN webdriver: Request failed with status 500 due to Context has not been changed
2022-10-07T12:54:44.110Z INFO webdriver: Retrying 3/3
2022-10-07T12:54:44.110Z INFO webdriver: [POST] http://localhost:4444/wd/hub/session
2022-10-07T12:54:44.110Z INFO webdriver: DATA {
  capabilities: {
    alwaysMatch: { browserName: 'chrome', 'goog:chromeOptions': [Object] },
    firstMatch: [ {} ]
  },
  desiredCapabilities: {
    browserName: 'chrome',
    'goog:chromeOptions': { args: [Array], prefs: {} }
  }
}
2022-10-07T12:54:44.114Z DEBUG webdriver: request failed due to response error: unknown error
2022-10-07T12:54:44.114Z ERROR webdriver: Request failed with status 500 due to unknown error: Context has not been changed
2022-10-07T12:54:44.114Z ERROR webdriver: unknown error: Context has not been changed
    at getErrorFromResponseBody (/builds/digitalhub/applications/frontend/t3d/node_modules/webdriver/build/utils.js:198:12)
    at NodeJSRequest._request (/builds/digitalhub/applications/frontend/t3d/node_modules/webdriver/build/request/index.js:166:60)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
2022-10-07T12:54:44.115Z ERROR @wdio/runner: Error: Failed to create session.
Context has not been changed
    at startWebDriverSession (/builds/digitalhub/applications/frontend/t3d/node_modules/webdriver/build/utils.js:73:15)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
`

Code of Conduct

Is there an existing issue for this?

christian-bromann commented 2 years ago

Thanks for reporting. I believe this issue is better reported in the Selenium project where the Selenium Server that is used here is developed. I am not sure how the WebdriverIO project could fix this. Maybe try different capabilities or debug the tests directly within CI.

I am gonna close as I don't see anything actionable to do. Happy to answer further questions.

Yurii397 commented 2 years ago

@christian-bromann thanks for the response. Could you plz send a link to their repo?

christian-bromann commented 2 years ago

https://github.com/SeleniumHQ/selenium