My Mobile xpath is not working


#1

Hi all,I am new to Katalon
I try to download app in play store.
In Katalon studio, I use spy mobile to get the object. And it work properly.

Then, problem is when I choose the way detect object by xpath , and it will show me can’t find the object.
What should I do?
Because I want to do test on many kind of device, so I can’t choose the way detect by text.I think xpath is better and also absolutely on most device.

Does anyone know what wrong with xpath?
Maybe my idea is wrong, could you explain it?

Thank you


#2

Hi @hoihoi000a,

You’re correct that xpath is a good way to find elements. One of the advantages of Katalon Studio is that it will generate an xpath for you from the selected properties of the Test Object. So in the first screenshot, you can choose class and text (I would advise against selecting instance) and Katalon will create an xpath when it runs the tests. You don’t have to select the xpath property - in fact, that could lead to more problems and brittle tests.

Here is a screenshot of one of my Test Objects and the xpath in the dark grey area at the bottom that it will automatically create for me:

Hope this helps,

Chris