簡體   English   中英

使用Selenium Webdriver的SeeTest Automation中的滾動問題

[英]Scrolling issue in SeeTest Automation using Selenium webdriver

我在使用移動Webdriver + Selenium的Android自動化的SeeTest Automation面臨滾動問題。

我也嘗試過JScriptExcecutor和Scroll方法,但是我無法滾動,因此有人可以為此提供幫助嗎?

您可以使用屏幕尺寸在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) {

                }    
          }

將此添加到我們的代碼中,只需使用scroll(); 在您的測試案例中

暫無
暫無

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

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