简体   繁体   English

使用Selenium Webdriver的SeeTest Automation中的滚动问题

[英]Scrolling issue in SeeTest Automation using Selenium webdriver

I am facing Scrolling issue in SeeTest Automation for Android automation using Mobile Webdriver + Selenium . 我在使用移动Webdriver + Selenium的Android自动化的SeeTest Automation面临滚动问题。

I have tried JScriptExcecutor , Scroll methods also but i was not able to scroll so anyone can help me regarding this ? 我也尝试过JScriptExcecutor和Scroll方法,但是我无法滚动,因此有人可以为此提供帮助吗?

you can scroll in android device using screen dimensions, find the below function, 您可以使用屏幕尺寸在android设备中滚动,找到以下功能,

public void scroll() throws IOException {
              try {
                Dimension dimensions = driver.manage().window().getSize();
                System.out.println("Size of Window= " +dimensions);
                int Startpoint = (int) (dimensions.getHeight() * 0.5);
                System.out.println("Size of scrollStart= " +Startpoint );
                int scrollEnd = (int) (dimensions.getHeight() * 0.2);
                System.out.println("Size of cscrollEnd= " + scrollEnd);             
                driver.swipe(0, Startpoint,0,scrollEnd,1000);           

                } catch (IOException e) {

                }    
          }

add this to ur code and simply use scroll(); 将此添加到我们的代码中,只需使用scroll(); in ur test case 在您的测试案例中

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM