lundi 20 juin 2016

How to get the element before last?

In Protractor, there is the .first() and .last() methods available on ElementArrayFinder:

var elements = element.all(by.css(".myclass"));

elements.last();
elements.first();

But, how to get the element just before the last one (penultimate) without knowing how many elements are there in total?

Aucun commentaire:

Enregistrer un commentaire