I think that Execution Profiles and Global Variables might help you in this case:
You would create a new global variable in the “default” profile that you can refer to by name in all of your tests:
Then change all of your tests to take a variable as the apk name in the
import internal.GlobalVariable as GlobalVariable
String appFile = GlobalVariable.G_AndroidApp
All you have to do to change the apk going forward is to update that global variable.
You said you had a lot of
startApplication calls, so something to think about for optimization is to reduce the number of those calls - usually, I only have one
startApplication for my entire suite of tests.
Starting and stopping the application between tests is usually unnecessary depending on whether you need each test to start from the beginning of the app launch. You might want to consider looking at Test Suites, if you haven’t already. Test Suites let you perform some action once, e.g.
startApplication, and then run a bunch of related Test Cases together. Without knowing much about your testing, I don’t know if this would be useful, but I have found that it greatly reduced the delay between tests, shortening the overall test execution time.
Hope this helps,