I am currently creating some tests using an Android device. My tests should work across 2 apps. I noticed that when switching apps, due to the ‘resource-id’ differing I was getting errors when running my tests. I have tried to read up about global variables ect but I am unsure how to resolve this issue.
e.g of resource-id value = com.test.testapp10:id/design_menu_item_text - for app 1
com.testworld.testappnative10:id/design_menu_item_text - for app 2
Can anyone help ?
There is a post here that deals with a similar issue and may be helpful:
I am trying to parameterize a part of resource id. We have different products, each product has a different package name which is added to the resource id, I want to parameterize the package name. Because it is the same test object, just the product changes, hence the package name. Is there any way I can do it?
@Chris_Trevarthen, thanks, I will take a look
@Chris_Trevarthen Hi, I have had a look and I am a bit confused about how to get this all setup.
Would I need to create 2 profiles which have the same value for the global variables ?
Yes, you would create 2 profiles with the same variable included, e.g.
Then you can update your test objects to include the reference to the Global Variable like this:
or you can do it in the test scripts like so:
@kazurayam I faced exactly the same use-case as a topic-starter. I have 3 applications to run Katalon-tests with. All these applications is basically copy-pasted from the main one, so my test-scripts can be run for each of 3 apps. But package name for each of them differs. All my test object were created by “Spy Mobile” option and (I don’t know why(!!!)) “resource-id” parameter always begins with “packageName” of the app. So I have the same objects to deal with (tap for example) but these object…
When you run the test, select the profile and the test should inject the appropriate package name to the object.
Hope this helps,