【发布时间】:2020-10-05 20:08:46
【问题描述】:
我正在尝试选择一个下拉值,但下拉列表位于 android.widget.ScrollView 下,我在其中找不到任何其他定位器。
这是元素的样子
我试过下面的代码
String DESTINATION_ELEMENT_TEXT= "DE";
driver.findElementByAndroidUIAutomator("new UiScrollable(new UiSelector()).scrollIntoView(new UiSelector().textContains(\""+DESTINATION_ELEMENT_TEXT+"\"))");
它确实执行滚动直到所有下拉值但无法选择DE作为值并最终抛出异常:
org.openqa.selenium.NoSuchElementException:一个元素不能 使用给定的搜索参数位于页面上。为了 有关此错误的文档,请访问: http://seleniumhq.org/exceptions/no_such_element.html
有人可以帮我处理滚动视图并选择所需的值吗?
【问题讨论】:
标签: java selenium appium appium-android android-uiautomator