Mallesh JM Mallesh JM - 3 months ago 12
AngularJS Question

md-select drop down selection

we have a md-table with 20 rows. each row will have a drop down and three values. select, accept and deny. I am trying to select the value accept or deny but i get element not visible error. i tried adding waitforAngular and sleep time. but it doesnt seem to work. it clicks on the drop down and later fails without clicking on accept.

Any suggestions. thanks

element.all(by.model('result.status')).get(0).click();
browser.driver.sleep(2000);
browser.waitForAngular();
//select.$('[value="Accept"]').click();
element.all(by.css('md-option[value="Accept"]')).get(0).click();

Answer

Instead of clicking the option in the drop down, use sendKeys() to send the value you want directly to the drop down element.

element.all(by.model('result.status')).get(0).sendKeys('Acce‌​pt');