TestProject Forum
Powered by leading experts in the test automation community

TestProject incorrectly determines the coordinates of the element

Hi All,
I am using TestProject to record KAYAK app on Samsung galaxy A5 device with Android. HOwever, TestProject incorrectly determines the coordinates of the element. Could you please refer a attached video and give me advise, thank you very much
My laptop : windows 10 with screen resolution :1366x768.
https://drive.google.com/file/d/1Pg3xP11O1_BbBzhkDA8F4kB98NdwL-gU/view?usp=sharing

Hi Son,

Even-though the element is not highlighted correctly in the element inspector, please try using it in your code.
Also, please pay attention that there are more than one element - there are 4 matches.

You can use a hierarchical XPATH or a smart XPATH as following to find the right one:
//android.widget.LinearLayout[@package = ‘com.kayak.android’ and contains(@resource-id , 'legsContainer’)][1]

Notice the indexer suffix: [1]

Thank you, the issue is resolved