Appium 滚动直到找不到元素



我找到了滚动的代码,直到找到元素,

WebElement el = driver.findElementByAndroidUIAutomator
("new UiScrollable(new UiSelector().scrollable(true).instance(0))
.scrollIntoView(new UiSelector().textContains(""+text+"").instance(0))");
el.click();

如何修改该代码以滚动,直到元素不包含特定文本?

尝试这样的事情,它是在 python 中,但不言自明 -

def scroll_element_into_view_android(list_element, search_text):
element = driver.find_element_by_android_uiautomator(
'new UiScrollable(new UiSelector().resourceId("' + list_element + '")).scrollIntoView(new UiSelector().textContains("' + search_text + '").instance(0));')
return element

最新更新