Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webkit returns additional new line character with element.innerText #3932

Open
teemuteemu opened this issue Dec 2, 2024 · 2 comments
Open
Labels
bug Something isn't working priority: medium

Comments

@teemuteemu
Copy link

Describe the bug
When using Get Text keyword using Webkit there's an additional new line character in the returned text. This has been reported to Playwright (microsoft/playwright#7698 and microsoft/playwright#5478) where suggestion is to use element.textContent instead.

If I'm not mistaken Get Text keyword returns element.innerText (

return await element.innerText();
). I know this is a Webkit specific issue but I'd be interested to know what is the reason for use of innerText? Element.textContent would fix this (for us) but there's probably a good reason to use innerText?

To Reproduce
Steps to reproduce the behavior:

  1. Set HTML content foo
  2. ${text} = Get Text id=important
  3. On Chromium and Firefox ${text} == "foo"
  4. On Webkit ${text} == "foo\n"

Expected behavior
I would expect the text content to be the same on Chromium, Firefox and Webkit.

Screenshots

Desktop (please complete the following information):

  • OS: macOs 15.1.1 (24B91)
  • Browser webkit
  • Version v19.1.0

Smartphone (please complete the following information):

Additional context

@aaltat aaltat added bug Something isn't working priority: medium labels Dec 11, 2024
@aaltat
Copy link
Member

aaltat commented Dec 11, 2024

@allcontributors please add @teemuteemu for bugs

Copy link
Contributor

@aaltat

I've put up a pull request to add @teemuteemu! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority: medium
Projects
None yet
Development

No branches or pull requests

2 participants