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.

@wdio/sync: HTTPError: Response code 404 (Not Found)

See original GitHub issue

Console log throws error 404 as shown below when using multi remote feature using selenium and browserstack services

Execution of 1 spec files started at 2020-10-14T21:28:37.937Z

2020-10-14T21:28:37.940Z DEBUG @wdio/utils:initialiseServices: initialise service "selenium-standalone" as NPM package
2020-10-14T21:28:37.947Z DEBUG @wdio/utils:initialiseServices: initialise service "browserstack" as NPM package
2020-10-14T21:28:37.948Z INFO @wdio/cli:launcher: Run onPrepare hook
2020-10-14T21:28:37.953Z INFO @wdio/browserstack-service: browserstackLocal is not enabled - skipping...
2020-10-14T21:28:41.640Z INFO @wdio/cli:launcher: Run onWorkerStart hook
2020-10-14T21:28:41.645Z INFO @wdio/local-runner: Start worker 0-0 with arg: wdio4.conf.js
[0-0] 2020-10-14T21:28:42.217Z INFO @wdio/local-runner: Run worker command: run
[0-0] 2020-10-14T21:28:43.084Z DEBUG @wdio/local-runner:utils: init multiremote session
[0-0] 2020-10-14T21:28:43.086Z INFO webdriverio: Initiate new session using the ./protocol-stub protocol
[0-0] 2020-10-14T21:28:43.087Z INFO webdriverio: Initiate new session using the ./protocol-stub protocol
[0-0] RUNNING in MultiRemote - C:\Users\amrka\Desktop\Work\Appium-wdio\src\test\specs\CrossPlatform_Suite.js
[0-0] 2020-10-14T21:28:43.116Z DEBUG @wdio/utils:initialiseServices: initialise service "selenium-standalone" as NPM package
2020-10-14T21:28:43.117Z DEBUG @wdio/utils:initialiseServices: initialise service "browserstack" as NPM package
[0-0] 2020-10-14T21:28:43.118Z DEBUG @wdio/local-runner:utils: init multiremote session
[0-0] 2020-10-14T21:28:43.121Z INFO webdriverio: Initiate new session using the webdriver protocol
[0-0] 2020-10-14T21:28:43.121Z INFO webdriverio: Initiate new session using the webdriver protocol
[0-0] 2020-10-14T21:28:43.122Z INFO webdriver: [POST] http://localhost:4444/wd/hub/session
[0-0] 2020-10-14T21:28:43.122Z INFO webdriver: DATA {
  capabilities: {
    alwaysMatch: {
      browserName: 'chrome',
      acceptInsecureCerts: true,
      'goog:chromeOptions': [Object]
    },
    firstMatch: [ {} ]
  },
  desiredCapabilities: {
    browserName: 'chrome',
    acceptInsecureCerts: true,
    'goog:chromeOptions': { args: [Array] }
  }
}
[0-0] 2020-10-14T21:28:43.129Z INFO webdriver: [POST] https://hub-cloud.browserstack.com/wd/hub/session
2020-10-14T21:28:43.129Z INFO webdriver: DATA {
  capabilities: {
    alwaysMatch: {
      platformName: 'Android',
      device: 'Samsung Galaxy S20',
      os_version: '10.0',
      project: 'Safe App Android automation test',
      build: 'APP Android Build',
      name: 'APP - testV 1.87.000',
      app: 'bs://aaaaa',
      autoGrantPermissions: true,
      nativeWebScreenshot: true,
      endureWebviewsHavePages: true,
      disableWindowAnimation: true,
      'bstack:options': [Object]
    },
    firstMatch: [ {} ]
  },
  desiredCapabilities: {
    platformName: 'Android',
    device: 'Samsung Galaxy S20',
    os_version: '10.0',
    project: 'App Android automation test',
    build: 'APP Android Build',
    name: 'APP - test V 1.87.000',
    app: 'bs://aaaa',
    autoGrantPermissions: true,
    nativeWebScreenshot: true,
    endureWebviewsHavePages: true,
    disableWindowAnimation: true,
    'bstack:options': { appium_version: '1.18.0' }
  }
}
[0-0] 2020-10-14T21:29:03.143Z ERROR @wdio/sync: HTTPError: Response code 404 (Not Found)
    at Request.<anonymous> (C:\Users\amrka\Desktop\Work\Appium-wdio\node_modules\got\dist\source\as-promise\index.js:117:42)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
[0-0] 2020-10-14T21:29:03.251Z INFO webdriver: COMMAND navigateTo("https://pentest.test.com/")
[0-0] 2020-10-14T21:29:03.252Z INFO webdriver: [POST] http://localhost:4444/wd/hub/session/45d210fcfcbd7214c8068b52b6340102/url
2020-10-14T21:29:03.252Z INFO webdriver: DATA { url: 'https://pentest.test.com/' }
[0-0] (node:13624) UnhandledPromiseRejectionWarning: HTTPError: Response code 404 (Not Found)
    at Request.<anonymous> (C:\Users\amrka\Desktop\Work\Appium-wdio\node_modules\got\dist\source\as-promise\index.js:117:42)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
[0-0] (node:13624) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)  
(node:13624) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:15 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
christian-bromanncommented, Oct 15, 2020

@hieuxlu browser.capabilities should give you access to this information.

0reactions
hieuxlucommented, Dec 1, 2020

@hananconnectavo Hi, I could not reproduce with Browserstack Automate, so it’s very likely it’s a problem with your iOS configuration, so BrowserStack server responded 404 (maybe the app id is not found). This results in the session not created and so subsequent calls returned 404 as well.

Normally, you should see a log indicating a new Browserstack session is created successfully as below. Notice the line Requesting Browserstack session URL.

I would recommend that you check your setup with Browserstack alone, and in single remote config first, to see if the iOS app is working.

2020-12-01T01:22:26.914Z INFO webdriver: [POST] https://hub-cloud.browserstack.com/wd/hub/session
2020-12-01T01:22:26.914Z INFO webdriver: DATA {
  capabilities: {
    alwaysMatch: { browserName: 'chrome', 'bstack:options': {} },
    firstMatch: [ {} ]
  },
  desiredCapabilities: { browserName: 'chrome', 'bstack:options': {} }
}
2020-12-01T01:22:39.163Z DEBUG @wdio/browserstack-service: Requesting Browserstack session URL at https://api.browserstack.com/automate/sessions/83e60806fffba4ac9263e5403baf59e361c20fd4.json
2020-12-01T01:22:40.410Z INFO @wdio/browserstack-service: chrome session: https://automate.browserstack.com/builds/a59f2497e408930467ba294bff59eed51f30a53d/sessions/83e60806fffba4ac9263e5403baf59e361c20fd4
2020-12-01T01:22:40.417Z INFO @wdio/browserstack-service: Update multiremote job for browser "browserB" and sessionId 83e60806fffba4ac9263e5403baf59e361c20fd4
2020-12-01T01:22:40.418Z DEBUG @wdio/browserstack-service: Updating Browserstack session at https://api.browserstack.com/automate/sessions/83e60806fffba4ac9263e5403baf59e361c20fd4.json with request body:  { name: 'multiremote example' }
Read more comments on GitHub >

github_iconTop Results From Across the Web

webdriverio/webdriverio - Gitter
Error : Could not load plugin wdio from module '. ... (node:80447) UnhandledPromiseRejectionWarning: HTTPError: Response code 404 (Not Found) at onResponse ...
Read more >
@wdio/sync - npm
A WebdriverIO plugin. Helper module to run WebdriverIO commands synchronously. Latest version: 7.27.0, last published: a month ago.
Read more >
How do I catch GotError [HTTPError]: Response code 404 (Not ...
I would use got(...).then( response => { /* handle good response here */}, error => { /* handle error here */ } )....
Read more >
404 Page Not Found Error: What It Is and How to Fix It - Lifewire
The 404 Not Found error, also called Error 404 or an HTTP 404 error, ... a number after the 404, as in HTTP...
Read more >
ERROR @wdio/sync: TypeError: hook.apply is not a function ...
ERROR @wdio/sync: TypeError: hook.apply is not a function at execHook. Problem. hook.apply is not a function at execHook ...
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