簡體   English   中英

Appium滾動直到找不到元素

[英]Appium scroll until not find element

我找到了滾動代碼直到找到元素,

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM