I wanted to do find by class_name
and return last element among all elements.
In jquery, we can write something like below but that don't seems to work in capybara
find(".delete:last")
If you are using webkit
driver you can write something like -
find(".delete:last-child")
In capybara, you can get last element using below -
all(:css, ".delete").last
Is there any alternative to above?
question from:
https://stackoverflow.com/questions/18507392/how-to-find-last-matching-element-in-capybara 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…