How to handle Dynamically changing table index

Ask general questions here.
chiranthurs
Posts: 19
Joined: Mon Oct 29, 2018 1:09 pm

How to handle Dynamically changing table index

Post by chiranthurs » Wed May 08, 2019 9:17 am

Hi Team,

I am facing an issue in xpath where the table index keeps changing on every run due to which my script fails. I wanted to know how i can handle this table index .

As Highlighed in the screen shot, on every test run the "table[3]" can be "table[2]" or even "table[1]" next time. Not sure how i can handle this dynamic ally changing table index. Please help.
Attachments
SUT object.JPG
SUT object.JPG (142.52 KiB) Viewed 66 times
Dynamic tableindex.JPG
Dynamic tableindex.JPG (143.87 KiB) Viewed 66 times

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 5071
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: How to handle Dynamically changing table index

Post by odklizec » Wed May 08, 2019 10:31 am

Hi,

Could you please upload a Ranorex snapshot (NOT screenshot) of the table in question?

Have you simply tried to remove the index from xpath? If the xpath is not unique without index, then you will have to add a reference to another element, from which you can traverse to the table you want. For example, label “List of releasable positions” looks ideal? Eventually, you can use directly one of table’s headers? But without seeing snapshot, it’s hard to be more detailed.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration