繁体   English   中英

无法从特定的下拉菜单中选择项目(文本)?

[英]Unable to select item (Text) from a specific drop down menu?

目前,我正在尝试与一个下拉菜单进行交互,该菜单仅在单击后才显示特定文本。

看下面的示例图像: 在此处输入图片说明

<div class="" style="display: inline-block;">
<input autocapitalize="none" autocomplete="off" autocorrect="off" id="react-select-2-input" spellcheck="false" tabindex="0" type="text" aria-autocomplete="list" value="" style="box-sizing: content-box; width: 4px; background: 0px center; border: 0px; font-size: inherit; opacity: 1; outline: 0px; padding: 0px; color: inherit;"><div style="position: absolute; top: 0px; left: 0px; visibility: hidden; height: 0px; overflow: scroll; white-space: pre; font-size: 12px; font-family: sans-serif; font-weight: 300; font-style: normal; letter-spacing: normal; text-transform: none;">
</div>
</div>

从上图可以看到,单击元素时文本是可见的,但是当我检查元素时,看不到任何下拉文本项?

我尝试了以下方法:

  • 单击元素>然后使用链接文本
  • 使用列表遍历元素
  • 单击元素,然后尝试发送密钥
  • 另外,我无法使用select,正如您从html代码中看到的那样,其构造有所不同。

有任何想法吗?

一种选择是:

yourOption = element(by.id('react-select-2-input')).
yourOption.Click();
yourOption.sendKeys(Keys.DOWN);
yourOption.sendKeys(Keys.RETURN);

HTML的某处也必须有一个列表,该列表中将具有可供选择的选项。 它可能不是输入的直接父项或子项。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM