webdriverio: [πŸ› Bug]: W9 | unable to access element object properties e.g. ele.click() inside a method

Have you read the Contributing Guidelines on issues?

WebdriverIO Version

9

Node.js Version

20

Mode

WDIO Testrunner

Which capabilities are you using?

No response

What happened?

I’m able to access element object properties e.g. ele.click() with locator. See below image, If I hover on click method it show the details. Also, Visual Studio ID show the suggestions when press the . (dot)

image

But when a method accept element as a parameter and try to access its properties its not showing. Somehow the type is any now.

image

In the submit() method element signature is as below (property) FormPage.submitButton: ChainablePromiseElement

but in submitClick() method element signature is as below (parameter) ele: any

(parameter) ele: any

Note: created methods to show issues only

What is your expected behavior?

If element passed as a ChainablePromiseElement parameter, all the properties should be accessible inside the method

How to reproduce the bug.

create a method which accept ChainablePromiseElement as a parameter and see the type is any. Also in ID we are not able to access methods e.g. ele.click()

Relevant log output

NA

Code of Conduct

  • I agree to follow this project’s Code of Conduct

Is there an existing issue for this?

  • I have searched the existing issues

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 18 (18 by maintainers)

Most upvoted comments

Great to hear πŸ‘