How to click an element by innerthtml using CSS selectors in Selenium
I have HTML code like this
<td>Save</td>
I couldn't locate the element using FireFinder by td:contains("Save")
I开发者_C百科s FireFinder wont support the :contains or innerHTML cant be located by :contains?
Read that in Selenium too, :contains wont be supported? However, I couldn't find a documentation for that.
That should work in Selenium, I've just tried it myself. Make sure you specify that the locator type is CSS by preceding your locator with css=
. Also, the quotes shouldn't be necessary:
css=td:contains(Save)
Firefinder does not support :contains, however Firebug has another extension called FirePath. The selector type Sizzle is a javascript selector with the same syntax as CSS selectors but also supports :contains.
Also, although Firefinder does not support contains, Selenium does.
精彩评论