user2167582 user2167582 - 1 year ago 68
AngularJS Question

How to select a single item in protractor

Usually in protractor you can select singular element with:


Occasionally you get something like this:


which potentially has more than one element. What's the correct way to select an index from a locator that locates multiple elements, and still contain the protractor's methods for sending Keys?

Jmr Jmr
Answer Source

You can get an indexed element from an array returned with

// Get the 5th element matching the .dfdf css selector
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download