This site is in read only mode. Please continue to browse, but replying, likes, and other actions are disabled for now.
1 / 14
Jan 2018

While executing automation test cases written in java for iOS application it’s execution takes long time for execution.

Can any one have any idea about how to improve speed of execution?

Appium Desktop client Version : 1.7.1
MAC OS version : 10.12 sierra
iOS version iPhone 6 : 10.3.2

  • created

    Jan '18
  • last reply

    Jul '18
  • 13

    replies

  • 3.0k

    views

  • 5

    users

  • 1

    link

Hi @jaimin,

can you please explain more about the issue, in which thing is taking too much time, like: finding elements etc ?

It is working very slow on real device.

I am using accessibility id and xpath to find locator of element.

Check the implicit wait just after you are creating the object of your AppiumDriver or IOSDriver in your project.

like - driver = new IOSDriver(capabilities);
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);

reduce the time according to your need.

I have already removed implicit wait from my code. So it is taking 0ms to wait.

    if (config.getProperty("deviceType").equalsIgnoreCase("Real Device")) {
        capabilitiesIos.setCapability("xcodeConfigFile", TestBaseUtility.getFilePath(config.getProperty("iOSxConfigPath"), config.getProperty("iOSxConfigFileName")).getAbsolutePath());
        capabilitiesIos.setCapability("app", TestBaseUtility.getFilePath(config.getProperty("iOSAppIpaPath"), config.getProperty("iOSAppIpaName")).getAbsolutePath());
        capabilitiesIos.setCapability("udid", config.getProperty("deviceUdId"));
        capabilitiesIos.setCapability("agentPath","/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj");
        capabilitiesIos.setCapability("bootstrapPath","/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent");

    } else {
        File appDir = new File(config.getProperty("iOSApplicationPath"));
        File app = new File(appDir, config.getProperty("iOSAppName"));
        capabilitiesIos.setCapability("app", app.getAbsolutePath());
    }
    capabilitiesIos.setCapability("platformName", config.getProperty("iOSPlatformName"));
    capabilitiesIos.setCapability("deviceName", config.getProperty("deviceName"));
    capabilitiesIos.setCapability("bundleid", config.getProperty("bundleID"));
    capabilitiesIos.setCapability("automationName", config.getProperty("automationName"));
    //capabilitiesIos.setCapability("clearSystemFiles", true);
    capabilitiesIos.setCapability("realDeviceLogger", config.getProperty("realDeviceLogger"));
    driver = new IOSDriver(new URL("http://0.0.0.0:4723/wd/hub"), capabilitiesIos);

I find my iOS device automation time of execution of each step is 2x slower compare to iOS sim. Has anyone found a work around for this problem? My entire 200+ regression test suite takes about a whopping 16 hours to run!

I have used below wait statement to wait for every element visibility.
for this statement it is taking so much time.

public static void waiForVisibility(String xpath) {
    wait = new WebDriverWait(driver, 30);
    wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(xpath)));
}

you can reduce it by using 10 , instead of 30.

I think, It is the value of overall timeout. So It should not affect the slow execution.

It is taking 10-15 seconds of wait everytime, If element is already visible.

is it due to xpath I have used for wait?

5 months later

Hi guys,

I have similar problem. My setup is executing tests on a real device. And execution is extremely slow.
Sometimes it takes around 5s for taping on a button. I am using fluent waits. They are functioning correctly. I tried without them and I didn’t noticed any speeding up in test execution.

For locators i am using @iOSFindBy(accessibility = “SignInGoogle”)

page object are mapped PageFactory.initElements(new AppiumFieldDecorator(driver), this);

java-client is 6.1.0
appium desktop is 1.8.1
ios 10.13.5