Using ID rather than RESOURCE-ID on Android app


#1

Hello,

I am automating Android App on Android emulator.
I just launch the app and I want to click on a button using the ID of the element (ie removing package part of the resource-id).

My test object is found when I have:

resource-id EQUALS my.package:/id:myId

But If I want to use only myId to find the element, I was expecting to use :

resource-id CONTAINS myId
or
id EQUALS myId

But it is not finding the element :frowning:

Is there any way of using the id of the Mobile Element?


#2

Is there anything I can do for this issue?
Is there someone in Katalon team able to confirm that id is not supported by TestObject?
Currently I can only use resource-id which includes the package, but issue is that my application has a different package name, depending on the backend environment (dev, qa, preprod, prod…) and Condition does not seem to work


#3

Only ‘text’ field can use condition, no other properties can


#4

So there is no possibility to use id rather than resource-id as test object property for android automation?


#5

Can you try parameterizing the Test Object per this documentation:

https://docs.katalon.com/display/KD/Manage+Test+Object#ManageTestObject-ParameterizingTestObject

Hope this helps,
Chris


#6

quentin said:

Hello,

I am automating Android App on Android emulator.

I just launch the app and I want to click on a button using the ID of the element (ie removing package part of the resource-id).

My test object is found when I have:

resource-id EQUALS my.package:/id:myId

But If I want to use only myId to find the element, I was expecting to use :

resource-id CONTAINS myId

or

id EQUALS myId

But it is not finding the element :frowning:

Is there any way of using the id of the Mobile Element?

Hello Quentin,

I face the same issue. Did you find a solution to your problem? It would be really helpful.

Thank you.


#8

Hi, instead of using resource-id you can also use xpath. This works for me.
33%20PM