0

I am using WebStorm to write some automated tests. For one test, I must check if an alert prompts the user. To accomplish this, I want to use the .getAlertText(); method, however WebStorm does not recognize the method. It says "Unresolved function or method getAlertText()".

The WebdriverIO documentation shows that it is indeed a method: https://webdriver.io/docs/api/webdriver.html

How can I get WebStorm to allow me to use the method? Thank you.

Brian
  • 135
  • 4
  • 16
  • 1
    Post your [MCVE], what you tried, and the execution result including any error messages so we can better help you. – JeffC Dec 24 '18 at 23:11

2 Answers2

1

Unfortunately, this method is missing in wdio typings, that's why the IDE can't resolve it during static code analysis. I believe that this has to be submitted to either https://github.com/DefinitelyTyped/DefinitelyTyped/issues or https://github.com/webdriverio/webdriverio/issues

lena
  • 90,154
  • 11
  • 145
  • 150
  • Thank you! Does this mean that the method cannot be used, despite it being shown in the documentation? How about the method `.alertText()`? I am also having issues with this method as well. – Brian Dec 27 '18 at 00:07
  • no, it doesn't. It just means that the typings have to be updated to match the actual docs – lena Dec 27 '18 at 11:36
0

Reference: http://v4.webdriver.io/api/protocol/alertText.html

v4 have function alertText(); && v5 have getAlertText()

sonia
  • 11
  • 1