Mobile Automation and Global Variables

Hi @Amanda_Perkins1,

On the whole, Global Variables (aka Execution Profiles) should behave the same way in Web and Mobile tests:

https://docs.katalon.com/katalon-studio/docs/execution-profile-v54.html

As for not hardcoding paths to the .apk file so that you can use your tests in CI, I use the RunConfiguration.getProjectDir() to get the path of the current Katalon test. As a first step in my CI job, I pull in a pre-built .apk to a directory within the Katalon project, e.g. builds:

import com.kms.katalon.core.configuration.RunConfiguration

String filePath = RunConfiguration.getProjectDir() + "/builds/myApp.apk"
MobileBuiltInKeywords.startApplication(filePath, false);

Alternatively, you could use the Execution Profiles to set up a profile for CI test environments, including a filePath variable that you can set as the absolute path on your CI system to the .apk file. Then you can reference the variable in your tests:

import internal.GlobalVariable

String filePath = GlobalVariable.filePath
MobileBuiltInKeywords.startApplication(filePath, false);

Hope this helps,

Chris