How to verify "\u00A0 " Tool tip value using Selenium

32 views
Skip to first unread message

Bala Murugan V

unread,
Oct 12, 2021, 8:11:43 AM10/12/21
to seleniu...@googlegroups.com
Hello Team,
The actual tool tip  text showing as below
1) How do the partners make money?. 2) How much does each method contribute to overall revenue? 3) Stack rank by

But selenium stores the tooltip value like below. The extra "\u00A0 " is added in each sentence

1) How do the partners make money?.\u00A0 2) How much does each method contribute to overall revenue?\u00A0 3) Stack rank by

If we are asserting then it is failing.  How to validate this scenario?

Regards,
Bala

ddlionx

unread,
Oct 12, 2021, 8:17:38 AM10/12/21
to seleniu...@googlegroups.com
\u00A0 is not being added, it's what the element actually is. \u00A0 is a no-break space https://www.fileformat.info/info/unicode/char/00a0/index.htm

You can either assert against it or remove it from the HTML (either at the source or after you've got the element, but arguably then you aren't asserting something on the page but something you've modified).

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAANqfA0vtCyenU38TmTQz7P4Vf9F9rh0bgZOdqa_f%2BF9uX61Pw%40mail.gmail.com.

Avayambalk Karthik

unread,
Oct 12, 2021, 9:02:31 AM10/12/21
to seleniu...@googlegroups.com
you can use string.contains("your expected String") instead of string.contentEquals().



--

poobathy r

unread,
Oct 12, 2021, 10:27:10 AM10/12/21
to seleniu...@googlegroups.com
Hi

After getting the value just replace with empty space or trim that value before asserting 

Regards
Poobathy
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages