M
M
maestro072017-06-24 11:12:44
Software testing
maestro07, 2017-06-24 11:12:44

How to solve the protractor problem?

element.findElement(by.css('label', 'Старый пароль'))
            .then(
                element(by.css('input.mm-input')).sendKeys('qwerty');
            );

I need to find a label with a certain test and insert the value into the input. labels and inputs have the same class and the call goes to the first input all the time.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
maestro07, 2017-06-24
@maestro07

element.all(by.css('p.flex-container')).all(by.css('input')).get(0).sendKeys('qwerty');
element.all(by.css('p.flex-container')).all(by.css('input')).get(1).sendKeys('asd');
element.all(by.css('p.flex-container')).all(by.css('input')).get(2).sendKeys('asd');

the answer is

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question