【问题标题】:How to scroll to an element with appium using webdriveriO如何使用 webdriveriO 滚动到带有 appium 的元素
【发布时间】:2017-06-19 02:41:41
【问题描述】:

我正在使用以下命令: browser.scroll('#login');

我收到此错误 - 尚未实施。请帮助我们:http://appium.io/get-involved.html

【问题讨论】:

    标签: appium-ios


    【解决方案1】:
    public void scroll()
        {
            Dimension dimensions = driver.manage().window().getSize();  
            System.out.println(dimensions);
    
            Double screenHeightStart = dimensions.getHeight() * 0.5;
            int scrollStart = screenHeightStart.intValue();
    
            Double screenHeightEnd = dimensions.getHeight() * 0.2;
            int scrollEnd = screenHeightEnd.intValue();
    
            ((IOSDriver<MobileElement>) driver).swipe(0, scrollStart, 0, scrollEnd, 1000);  
        }
    

    【讨论】:

      【解决方案2】:

      使用这个命令:

      browser.execute("mobile: scroll", {direction: 'down'});
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2020-11-24
        • 2020-04-02
        • 2018-08-23
        • 2020-06-27
        • 2016-12-09
        • 2019-03-10
        • 1970-01-01
        • 2015-11-12
        相关资源
        最近更新 更多