如何从左到右滑动页面,反之亦然?

时间:2015-02-23 04:05:36

标签: java selendroid

我尝试使用以下代码来刷页面。但是,它对我没用。我怎么能刷一下?

       //Swipe Right to Left side of the Media Viewer
        WebElement pages = driver.findElement(By.id("media-container"));
        TouchActions flick = new TouchActions(driver).flick(pages, -100, 0, 0);
        flick.perform();
        sleep(1000);


        //Swipe Left to Right side of the Media Viewer
         WebElement page = driver.findElement(By.id("media-content"));
         TouchActions flicks = new TouchActions(driver).flick(page, -100, 0, 0);
         flicks.perform();
         sleep(7000);

0 个答案:

没有答案