Cascading Style Sheets (CSS) is a simple mechanism for adding style (e.g., fonts, colors, spacing) to Web documents.

learn more… | top users | synonyms

8
votes
2answers
19k views

A way to match on text using CSS locators

So I use xpath locators and slowly converting to CSS. I haven't found a way to do an exact match based on text. For example converting //a[text()='Log Out']. I know you can do css=a:contains('Log ...
2
votes
2answers
10k views

Selenium - Find exact text match using CSS locators

According to A way to match on text using CSS locators, we should be able to use "^$" to find exact text match using CSS locators. But with div class="item"><div ...