md-select下拉选择 [英] md-select drop down selection

查看:49
本文介绍了md-select下拉选择的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个包含20行的md表.每行都有一个下拉菜单和三个值.选择,接受和拒绝.我正在尝试选择值accept或deny,但是我得到了元素不可见的错误.我尝试添加waitforAngular和睡眠时间.但它似乎不起作用.它单击下拉列表,然后在未单击接受的情况下失败.

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.

任何建议.谢谢

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();

推荐答案

而不是单击下拉菜单中的选项,而是使用sendKeys()将所需的值直接发送到下拉元素.

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');

这篇关于md-select下拉选择的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆