1

i am a new learner, tried the Webdriverio tutorial from youtube, but it's not working the issue with configuration or setup, not able to understand,

Wrote a Simple program of launching a browser

Tried all the options but the Chrome browser is not launching,

This is the output:

PS C:\Users\User\OneDrive\Documents\Webdriver-io-examples> npx wdio run .\wdio.conf.js

Execution of 1 workers started at 2023-04-06T21:06:17.713Z

2023-04-06T21:06:17.867Z INFO chromedriver: Initiate Chromedriver Launcher (v8.1.1)
2023-04-06T21:06:17.869Z INFO @wdio/cli:launcher: Run onPrepare hook
2023-04-06T21:06:17.877Z INFO chromedriver: Start Chromedriver (C:\Users\User\OneDrive\Documents\Webdriver-io-examples\node_modules\chromedriver\lib\chromedriver\chromedriver.exe) with args --port=9515 --url-base=/
2023-04-06T21:06:25.576Z INFO chromedriver: Starting ChromeDriver 112.0.5615.49 (bd2a7bcb881c11e8cfe3078709382934e3916914-refs/branch-heads/5615@{#936}) on port 9515
2023-04-06T21:06:25.577Z INFO chromedriver: Only local connections are allowed.
2023-04-06T21:06:25.578Z INFO chromedriver: Please see https://chromedriver.chromium.org/security-considerations for 
suggestions on keeping ChromeDriver safe.
2023-04-06T21:06:25.597Z INFO chromedriver: ChromeDriver was started successfully.
2023-04-06T21:06:25.638Z INFO @wdio/cli:launcher: Run onWorkerStart hook
2023-04-06T21:06:25.642Z INFO @wdio/local-runner: Start worker 0-0 with arg: run,.\wdio.conf.js
[0-0] Error: "ts-node/esm/transpile-only 'resolve'" did not call the next hook in its chain and did not explicitly signal a shor[0-0]     at new NodeError (node:internal/errors:399:5)
[0-0]     at ESMLoader.resolve (node:internal/modules/esm/loader:846:13)
[0-0]     at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:7)
[0-0] FAILED
2023-04-06T21:06:26.287Z INFO @wdio/cli:launcher: Run onWorkerEnd hook
2023-04-06T21:06:26.288Z INFO @wdio/cli:launcher: Run onComplete hook

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

2023-04-06T21:06:26.294Z INFO @wdio/local-runner: Shutting down spawned worker
2023-04-06T21:06:26.547Z INFO @wdio/local-runner: Waiting for 0 to shut down gracefully
2023-04-06T21:06:26.549Z INFO @wdio/local-runner: shutting down

Project Structure

Package.json

{
  "name": "webdriver-io-examples",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "wdio": "wdio run ./wdio.conf.js"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "@wdio/cli": "^8.7.0",
    "@wdio/local-runner": "^8.7.0",
    "@wdio/mocha-framework": "^8.7.0",
    "@wdio/spec-reporter": "^8.7.0",
    "chromedriver": "^112.0.0",
    "wdio-chromedriver-service": "^8.1.1"
  }
}
Learner
  • 945
  • 11
  • 23
  • 38

1 Answers1

0

It looks like there was an error with the execution of your Webdriverio program. The output you provided shows that Chromedriver was successfully started, but then an error occurred with the following message:

[0-0] Error: "ts-node/esm/transpile-only 'resolve'" did not call the next hook in its chain and did not explicitly signal a shor[0-0] at new NodeError (node:internal/errors:399:5) [0-0] at ESMLoader.resolve (node:internal/modules/esm/loader:846:13) [0-0] at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:7)

This error message indicates that there was a problem with the TypeScript transpiler. It's possible that there is an issue with your configuration or setup that is causing this error.

Without seeing your code and configuration files, it's difficult to provide specific advice on how to resolve this issue. However, here are a few general troubleshooting steps you can try:

Check your configuration file: Make sure that your wdio.conf.js file is properly configured and that all the necessary settings are in place. You may want to compare your configuration file to a working example to see if there are any differences.

Check your dependencies: Make sure that all the necessary dependencies are installed and up-to-date. You can do this by running npm install in your project directory.

Try running a different example: If you're having trouble with a specific example, try running a different one to see if the problem persists. This can help you determine if the issue is with your configuration or with the example code itself.

shan98
  • 20
  • 4
  • Thank you very much, your tips were very good, i followed and able to resolve below is the solution to that , I need to install typescript "npm i -D typescript ts-node" https://stackoverflow.com/questions/75471228/error-ts-node-esm-transpile-only-resolve-did-not-call-the-next-hook-in-its – Learner Apr 06 '23 at 22:03
  • It's great that you were able to resolve the issue by installing TypeScript using the command "npm i -D typescript ts-node". – shan98 Apr 06 '23 at 22:46