S
S
Sergey Kudrya2015-05-19 11:20:20
Angular
Sergey Kudrya, 2015-05-19 11:20:20

Protractor angular js (testing). How to select a certain element from the list (option value=) and click it?

Good afternoon.
Help with the following, there are two panels on the page with different IDs, respectively, but their values ​​are the same (the number of elements (there are four in both panels) in the list and their name), so I can’t select the desired parameter and click it.
My protractor code:
it('sort AZ', function(){
browser.sleep(1000);
var allOptions = element(by.id('navbarBody')).element.all(by.model('sortSelected '));
expect(allOptions.count()).toEqual(4);
var aZ = allOptions.get(0);
aZ.click();
browser.sleep(4000);
expect(aZ.getText()). toEqual('AZ TITLE');
});
ad60d23c3c1c4091aba7a883b3748afb.png4e4889065ad749b0849f20d2a2b86335.png

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question