0

I am doing some automation testing and I am looking for an element that contains a specific text by passing in its param value. Annoyingly, I am looking for 'Safe 1' but the text in the html shows it as 'Safe 1'. So for testing purposes I want to include 'Safe 1' as a param to see if it finds it but not sure how to add it.

I tried:

'Safe${ }1'
'Safe\ \1'
'Safe\\ \\1'
'Safe '+   + '1'

I am using typescript

BruceyBandit
  • 3,978
  • 19
  • 72
  • 144
  • 1
    Does this answer your question? [How is a non-breaking space represented in a JavaScript string?](https://stackoverflow.com/questions/5237989/how-is-a-non-breaking-space-represented-in-a-javascript-string) – Yury Tarabanko Feb 16 '23 at 12:59

1 Answers1

0

Probably using the unicode version of it may work.

const nbsp = '\u00A0'
console.log(`save${nbsp};1`)

reference

Lucas A
  • 127
  • 1
  • 7