如何在应用程序中处理Auto Suggestion feild:紧急

时间:2017-05-09 08:10:53

标签: selenium appium

我想处理自动建议文本字段,其中输入几个字母将自动列出我想要单击的选项并选择该选项。但我在选择列表中的选项时遇到了问题

任何处理此问题的方法......请帮助我解决这个问题的一些建议...... enter image description here

1 个答案:

答案 0 :(得分:0)

After entering few characters wait until the screen which appears with suggestion using any xpath.


//Assume suggestionlist is your id 

driver.findelementbyid("suggestionlist")

One done take all elements in list.
@findby (id="suggestionlist")
List <AndroidElement> list;

once you get the list please manipulate that . 

foreach(element in list)
{
  if(element.gettext().equals("your desired value"))
  element.click();
}