Test execution on Mobile so slow

Hi @satish1607,

I’ve been trying to find some optimizations online, but without a lot of luck. Here is a thread where people were having an issue with an earlier version of Appium: https://github.com/facebookarchive/WebDriverAgent/issues/739

Some of the suggestions are:

  1. Use a simulator instead of a real device, because on a real device, there is a built-in 1 second delay for commands
  2. Set your Desired Capabilities for useJSONSource to true
  3. Set your Desired Capabilities for waitForQuiescence to false

For more info on setting Desired Capabilities in Katalon: https://docs.katalon.com/katalon-studio/docs/desired_capabilities_in_katalon.html#what-are-desired-capabilities

Also, some suggestions on how to optimize lookups from Facebook/WebDriverAgent: https://github.com/facebookarchive/WebDriverAgent/wiki/How-To-Achieve-The-Best-Lookup-Performance

Hope this helps,

Chris

Thanks Chris for you update, is there any way to switch the application in iOS like from message to chrome or message to camera etc. One more how do I press the Home button in iOS.

thanks

Hi @satish1607,

You should be able to start an existing application like Chrome or the Camera using MobileBuiltInKeywords.startExistingApplication: https://docs.katalon.com/katalon-studio/docs/mobile-keyword-start-existing-apps.html#description

To switch to an already running app, you should be able to use:

AppiumDriver<?> driver = MobileDriverFactory.getDriver()
driver.activateApp(bundle_id)

You’ll just need to find and provide the bundle_id of the other app you want to start.

As for the Home button in iOS, it doesn’t seem like people are having a lot of luck with it, but you could try this: https://appiumpro.com/editions/68 or try putting your current app into the background:

AppiumDriver<?> driver = MobileDriverFactory.getDriver()
driver.runAppInBackground(Duration.ofSeconds(-1));

Hope this helps,

Chris

1 Like

Superb Thanks a lot Chris I am able to switch the application successfully.

Could you please let me know for pressing Home button what I need to import?

driver.executeScript(“mobile: pressButton”, ImmutableMap.of(“name”, “home”));

Thanks

I just tried this and it seems to work with the Home button on iOS:

import io.appium.java_client.AppiumDriver as AppiumDriver
import com.kms.katalon.core.mobile.keyword.internal.MobileDriverFactory as MobileDriverFactory
import com.google.common.collect.ImmutableMap

AppiumDriver<?> driver = MobileDriverFactory.getDriver()
driver.executeScript('mobile: pressButton', ImmutableMap.of('name', 'home'));

Note that in Katalon Studio for Mac, if you press CMD+SHIFT+O it will auto-import any libraries in your test if it can find them (if there is more than one match, it might prompt you to choose).

Hope this helps,

Chris

1 Like

Thanks Chris it works for me, I am able to switch the application, I am able to go to home screen.

But one more problem I faced if unable to tap/open any application from Home screen. I capture the icon details but no luck. How do I launch/tap on any application icon going from home screen?

Thanks @Chris_Trevarthen

Hi @satish1607,

All of the icons on the home screen should be visible to Katalon/Appium. They show up as type of XCUIElementTypeIcon with a name that is the text under the icon, e.g. “Photos”, “Maps”, “Settings”, etc. You should be able to Spy Mobile on the home screen to capture an icon you want to tap, or dynamically create a Test Object using the type and name.

Hope this helps,

Chris

Hi @satish1607

Wondering if any of the suggested performance improvements from above ever worked for you. I am finding that entering text in iOS 13 with Katalon 7 is much much slower - takes 2 minutes to do so now! I’m trying to find the root of the problem.

– Chris

Nothing much improved while execution so I conveyed that execution is slow on Mac when compare to Android.

Thanks

This works for me one day later it stopped working don’t know why.

Thanks Chris for the help .

Hi buddy, Did you fixed up this Issue

03-17-2021 08:32:47 AM Test Cases/ExecuteAutomation

Elapsed time: 3.227s

Test Cases/ExecuteAutomation FAILED.
Reason:
groovy.lang.MissingPropertyException: No such property: CucumberEARunner for class: Script1615888833419
at ExecuteAutomation.run(ExecuteAutomation:20)
at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)
at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:398)
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:389)
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:368)
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:360)
at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:255)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:114)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:105)
at com.kms.katalon.core.main.TestCaseMain$runTestCase$0.call(Unknown Source)
at TempTestCase1615966361979.run(TempTestCase1615966361979.groovy:25)

Please help me resolve this error.

Hi @Chris_Trevarthen
I am facing same issue , execution time is too slow even on android, you can see in the picture for better clarity. Object has defined locator quite clearly, however each action takes 60s to complete even longer.
Appium: 1.22.3
Katalon: 8.3.0
Nodejs: 18.1.0
Can you tell me the solution to this issue? thanks

2 Likes

@Katalon_team Help me, pls