Handling mobile elements in Android App using Appium

How to Handle Scroll event in Android Mobile App?

MobileElement scrollEvent = (MobileElement) driver.findElement(By.id((“com.imaginea.fontli:id/txt_invite_friends”)));
scrollEvent.swipe(SwipeElementDirection.UP,2000);

How to check whether the particular element is available in the mobile app screen/activity?

if(driver.findElements(By.id(“btn_skip”)).size() < 1)
{
loginProcess();
}
else
{
WebElement button=driver.findElement(By.name(“SKIP”));
button.click();
loginProcess();
}

How to handle wait for screen loading/activity operation?

MobileElement ProfileTab = (MobileElement) driver.findElement(By.id(“profileTabView”));
WebDriverWait wait = new WebDriverWait(driver, 60);
wait.until(ExpectedConditions.visibilityOf(ProfileTab));
ProfileTab.click();

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s