Monday 23 November 2015

swipe by element

List<WebElement> list=driver.findElements(By.xpath("//*[contains(@resource-id,'com.shaadi.android:id/option_')]"));

    MobileElement element=(MobileElement) list.get(0);
  element.swipe(SwipeElementDirection.UP, 3000);

Above is list, below is for element

MobileElement abc = (MobileElement) driver.findElement(TestUtils
                      .GetProperties("Search_screen_Result_Right_Swipe"));
             // MobileElement abc
             // =(MobileElement)driver.findElement(By.id("com.shaadi.android:id/layout_profile_parent"));
             abc.swipe(SwipeElementDirection.RIGHT, 2000);

No comments:

Post a Comment