webdriverio/webdriverio

[🐛 Bug]: getText() is extracting the text as in DOM not how the text appears in the webpage

Open

#14,371 opened on 2025年4月4日

GitHub で見る
 (7 comments) (0 reactions) (0 assignees)JavaScript (6,029 stars) (1,793 forks)batch import
Bug 🐛help wanted

説明

Have you read the Contributing Guidelines on issues?

WebdriverIO Version

9.X.X

Node.js Version

20

Mode

Standalone Mode

Which capabilities are you using?

What happened?

In one of my scenario, the button text in DOM is 'You have been selected' and it shows as it is in webpage too, but my getText() returns 'you have been selected'. It seems getText() is always extracting the text of the element from DOM and in lower case, irrespective of its appearance in the DOM and in Web page  

What is your expected behavior?

Can we please get a consistent solution to extract the text as it appears in the webpage irrespective of what is in DOM

How to reproduce the bug.

try in any webpage where element text has a css text-transformation

Relevant log output

NIL

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

コントリビューターガイド

[🐛 Bug]: getText() is extracting the text as in DOM not how the text appears in the webpage · webdriverio/webdriverio#14371 | Good First Issue