selenium - css locator that would shortens multiple td's -


seleniumide in firefox, using locator of

css=table#students tr +tr td +td +td +td +td +td +td +td mytext 

for last column in thr row of table.
shorter way css locator ?

before switch xpath, like

//table//tr//td[contains(@text,'mytext')] 

or

//table//tr//td[8][text='mytext'] 

if want find last column, try last-of-type (i haven't tested on selenium-ide, works webdriver)

table#students tr + tr > td:last-of-type 

if want index 1 of td, use nth-of-type

table#students tr + tr > td:nth-of-type(8) 

if have use text find it, can't done using css selector, unless use sizzle.

table#students tr + tr > td:contains(mytext) 

Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -