【问题标题】:iOS: Swipe mobile app until text is visibleiOS:滑动移动应用程序直到文本可见
【发布时间】:2022-02-24 11:11:11
【问题描述】:

我正在尝试向下滑动应用程序并在“文本”可见时停止滑动。

我已经尝试过了,但我在“el”部分得到了 NoSuchElementException。它甚至没有进行滑动操作:

   el = self.driver.find_element_by_xpath('//*[contains(text(),'sometexthere')]')

self.driver.execute_script('mobile: scroll', {"element": el, "toVisible": True})

你知道在 iOS 应用中滑动到文本的任何其他方式吗?

语言:Python 来源:Selenium、Appium

【问题讨论】:

    标签: python ios selenium swipe appium-ios


    【解决方案1】:

    你可以试试这个:

    el = self.driver.find_element_by_xpath('//*[contains(text(),'sometexthere')]')
    el.send_keys("0.5") // For automating scroll
    

    在 java 代码中为我工作 阅读此 appium 文档:https://appium.io/docs/en/writing-running-appium/touch-actions/

    【讨论】:

      猜你喜欢
      • 2013-05-19
      • 1970-01-01
      • 2012-07-29
      • 1970-01-01
      • 2020-06-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多