0

I am building a testing project using Webdriver IO in the Mocha Chai Framework using the WebStorm IDE. Certain methods, including .getUrl(), .alertText(), and .keys() display as perfectly viable methods when written in the WebStorm IDE.

The IDE shows no errors, warnings, or anything showing that they are not recognized by WebStorm. In fact, when typing out the methods, they show up as recommended methods.

However, when I run the tests using npm run test in the command prompt, these portions of code do not get executed, and the console displays error messages stating "this.keys is not a function", "this.getUrl is not a function", and "this.alertText is not a function".

What could be the problem? If there is any more information needed, I'd be happy to comply. Thanks.

Brian
  • 135
  • 4
  • 16
  • 1
    Hello Brian! I might be able to help, unfortunately, your question is incomplete and has little chances to get answered as is. Please read the **[How-To-Ask](https://stackoverflow.com/help/how-to-ask)** article & edit your question adding more information. The **test-file**, the `devDependencies` & `dependencies` from `package.json` file, the **wdio.conf.js** important parts, like (are you using `sync`, or `async`) & if you're using it, the **page-object file**. – iamdanchiv Dec 27 '18 at 06:39
  • 1
    What happens if you use `browser.getUrl()`, or `client.getUrl()`? Maybe in the context you're running the script, the API functions haven't been added to the global context object. Yeah, it's a guessing game unless you give us the above details. :) Cheers man! – iamdanchiv Dec 27 '18 at 06:42

0 Answers0