This site is in read only mode. Please continue to browse, but replying, likes, and other actions are disabled for now.
1 / 6
Feb 2019

Getting different xpath for same element on different device.
OS of both devices: Android 7.0
Appium version: 1.10. 0
Need to find element using xpath since have to store the text in list and compare it further. As there is no unique id or text to identify the element, have to use only index of the element.

  • created

    Feb '19
  • last reply

    Feb '19
  • 5

    replies

  • 144

    views

  • 2

    users

  • 1

    like

I suggest you to ask your developer to add resource id or use class name because xpath is not something you can rely on while doing automation.

As per my knowledge you can see object indexes based on the number of element visible on the screen.

If screen size is large and you have 10 objects with same ids then it will create index from 0 to 9 and if another device which is small in size will show only 7 objects then you’ll be getting indexes from 0 to 6.

I hope this is the case you are facing.