Start Application (input) apk file

HI everyone,

I did a few test cases by recording it.
I just wanna know, is there any other way for me to change all the input data (Start Application) for all test cases.
There is so many test cases created, i can’t change it 1 by 1.
I need to change to the new apk file.

Please advise. Thank you

HI @Chris_Trevarthen could you please assist me on this matters.
Because my team keep on giving me different apk files. So everytime i want run it, i need to change the apk 1 by 1 for all my test cases (100 +)

Please advise if there is any other way to make it easier

Thanks

Hi @ridzuan,

I think that Execution Profiles and Global Variables might help you in this case:

https://docs.katalon.com/katalon-studio/docs/global-variables.html#define-a-global-variable

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

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 startApplication function:

import internal.GlobalVariable as GlobalVariable

String appFile = GlobalVariable.G_AndroidApp
MobileBuiltInKeywords.startApplication(appFile, false);

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.

https://docs.katalon.com/katalon-studio/videos/create_run_test_suite.html

Hope this helps,

Chris

1 Like

HI @Chris_Trevarthen,

Thank you for your assistant. It working well now.

1 Like