Appium 1.6.5 with Android App is incredibly slow

Hello everybody,

we recently discovered Appium and decided to use it for our app (iOS and android).
We use Appium 1.6.5 with latest Appium Desktop (1.2.1) with Java and started implementing the tests for iOS first. We had to add accessibility ids everywhere, but thats propably worth it :stuck_out_tongue:

So, everything was fine and allā€¦ and then we wanted to get it running on Android.
Now every little WebDriverWait-findElement takes 30 secondsā€¦ even though we explicitly use 2 - 5 seconds as timeout. A test that takes 30 seconds to run in iOS takes 3m 40s on Android. Writing tests is extremely slow this way. Maybe somebody here has an idea what could be causing this.

Thanks in advance

@BlaXun we do not use ā€œWebDriverWaitā€ but page object instead. no problems with speed: Android Real/Emulator + iOS Simulator/Real

Okay, but what about timing problems where the page-object doesnt have the element yet. Did you write a method for such conditions yourself? It sounds like youā€™d waste a lot of what the SDK has to offer if u skip all the findElement-Methodsā€¦ or am I missunderstanding?

@BlaXun i have no idea about your code :-). but lets say we have general like:

// we open driver
driver = new AndroidDriver<>(new URL(baseURL + port + minorURL), capabilities);

// we set timeout for finding elements
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS); //10 sec

// we trying to find any element
WebElement el = driver.findElement(MobileBy.id("some_ID"); // if element exists it should be found fast otherwise it will trying to search for it for 10 sec.

is it your way?

Nope, we donā€˜t set implicitWait timeout.

What we do is the following:

public static WebElement waitForVisibleElement(By locator, int timeout, WebElement parent) {
WebDriverWait wait = new WebDriverWait(driver, timeout);
return wait.until(ExpectedConditions.visibilityOf(parent.findElement(locator)));
}

We use WebDrierWait for nearly every command where we need an element. We even only search in the context of another WebElement. However, even when we use only 5 seconds for a timeout it will wait 30 secondsā€¦ its like it ignores this parameter.