Can i use same script say of Android over different servers

Can i use same script of Android/ ios over different servers, if may apk/ ipa path is changed over all the servers.

If YES, what all changes do i need to make in the script

Can i use same script of Android/ ios over different servers, if may apk/ ipa path is changed over all the servers.

If YES, what all changes do i need to make in the script

Hi there,

What are your needs in this case so that I can tell you needed changes to adapt with it?

Thanks

____________________
Thank you for choosing Katalon Studio as your automation solution.
Your feedback is needed to make Katalon Studio a better tool, take the survey at: https://goo.gl/S25NVO

Hi,

I am creating Android scripts over my local system and apk is also on my system.
Now i want to use this same script over different machine, but my apk file path is now changed i.e. may be that particular server.

I want to execute using command prompt over there. So since path of apk is different while creating the script and at the time of execution, so how will i accomplish this.

Hi there,

In this case I would suggest the following solutions:
1. Store apk path as a global variables.
2. Add commands to change apk path Global Variables accordingly using search and replace solution, e.g:
- Down FART: https://sourceforge.net/projects/fart-it/ and put it in desired location , e.g: C:\fart
- Add commands to search and replace apk path on its server before you execute Katalon commands, e.g:
C:
cd C:\fart
fart.exe “C:\YourProject\GlobalVariables.glbl” “oldAPKPath” “newAPKPath”

That is the general solution.

Thanks

____________________
Thank you for choosing Katalon Studio as your automation solution.
Your feedback is needed to make Katalon Studio a better tool, take the survey at: https://goo.gl/S25NVO

I didn’t get the solution.
Can u please elobrate it with complete steps or screenshot.
How to create Global Variable???
How to add Global Variable in cmd command???
and all related points.

Hi there

Ah sorry, I’ve thought a better solution. You just need to store your apk locally in your project folder and then call it directly using supported functions. So you don’t need to worry about different apk path. Please refer to Sample Mobile Project which is included in Katalon Studio. It is using my proposed solution:

'Get full directory\‘s path of android application’
def appPath = PathUtil.relativeToAbsolutePath(GlobalVariable.G_AndroidApp, RunConfiguration.getProjectDir())

Mobile.startApplication(appPath, false)

To create a Global Variables, please refer to this article: https://docs.katalon.com/display/KD/Variable+Types#VariableTypes-Globalvariables

Thanks

____________________
Thank you for choosing Katalon Studio as your automation solution.
Your feedback is needed to make Katalon Studio a better tool, take the survey at: https://goo.gl/S25NVO

Can’t we pass application i.e. apk path in the command???

Hi Vivek,

No that is not supported yet. If you really want to do that, then you will need to do my previous suggested solution by directly replacing Global Variables value in our local Global Variable file, is it what you want to achieve?

Thanks

____________________
Thank you for choosing Katalon Studio as your automation solution.
Your feedback is needed to make Katalon Studio a better tool, take the survey at: https://goo.gl/S25NVO

Actually what i want to accomplish
i. I will build an Android application using Jenkins
ii. It will give me an apk file
iii. I want to run my script over the generated apk file

Hi Vivek,

So I assume you’ve already known generated apk path from step 1 and 2, I won’t talk about how you generate it. To accomplish ‘I want to run my script over the generated apk file’, I would suggest the following solutions:
1. Change input APK path in ‘Start Application’ to refer to the relative path of your current project. Please refer to sample mobile project in Katalon Studio for how to do this.
2. From Jenkins, add commands (Windows) or Shell (Mac/Linux) after your apk file is generated to copy and overwrite it to the same apk file you’ve created from #1.

So everytime you start your script, it will use the newest generated file from your Jenkins.

Please note this is a general solution to adapt with how you are currently setup with your CI/CD in this case, not a specific solution to Katalon Studio.

Thanks

____________________
Thank you for choosing Katalon Studio as your automation solution.
Your feedback is needed to make Katalon Studio a better tool, take the survey at: https://goo.gl/S25NVO

Hi,

Is it possible to directly run script without having any apk path i.e. over already installed application???

As in appium we can do it by using app-package and app-activity.

Thanks

Hi Vivek,

That’s not supported yet in Katalon Studio.I believe in Appium you must know app-package and app-activity values by your own , is it correct?

Thanks

____________________
Thank you for choosing Katalon Studio as your automation solution.
Your feedback is needed to make Katalon Studio a better tool, take the survey at: https://goo.gl/S25NVO