#14371·webdriverio

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

Author: arifaman59Created Apr 4, 2025Updated Sep 20, 2026
LabelsBug 🐛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?

typescript

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

typescript
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