Xpath changed from tables, Control id's to containers and cells

Ranorex Studio, Spy, Recorder, and Driver.
R_CH
Posts: 1
Joined: Wed May 26, 2021 12:53 pm

Xpath changed from tables, Control id's to containers and cells

Post by R_CH » Wed May 26, 2021 1:23 pm

Hi,

I am facing an issue about xpath changes which seems to be not controlled by developers. Earlier, Xpath editor identified the elements as tables and controlIDs. Now it has been changed to containers and cells.

For Ex.:
old Xpath:
/html/body/form/div[3]/div[2]/div/div[15]/table/tbody/tr/td/div/div/div[2]/table/tbody/tr/td/span/div/div[1]/div/table/tbody/tr[1]/td[1]/table/tbody/tr[2]/td[2]/input[1]//*[@id="ctl00_StartContent_UCNk_ctl00_ctrl_3"]

New Xpath:
/container/container[@accessiblerole='Grouping']/container[@accessiblerole='Grouping']/container[2]/table[@accessiblerole='Table']//container/container[@accessiblerole='Grouping']/table[@accessiblerole='Table']//container/container[@accessiblerole='Grouping']/container[1]/?/?/table[@accessiblerole='Table']/row[1]/cell[@accessiblename>'Anrede, Titel Vorname Nachname*']/table[@accessiblerole='Table']/row[2]/cell[@accessiblename='    ']/text[1]

I am doing automation for web applications. It's such a pain to rebuild all the repository items. Any idea why it has been changed the Xpath with containers.
Last edited by R_CH on Thu May 27, 2021 7:21 am, edited 1 time in total.

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

Re: Xpath changed from tables, Control id's to containers and cells

Post by odklizec » Thu May 27, 2021 7:16 am

Hi,

Unfortunately, it's pretty hard to tell why the xpaths changed? The most probably reason is, that the application under test now uses different UI technology? Another possibility is, that you've played with the xpath weight editor and changed something there? In this case, Ranorex could return different xpaths, based of the xpath weight you eventually applied?

Check these topics, regarding xpath weights and examine your actual settings...
https://www.ranorex.com/help/latest/ran ... e-weights/
https://www.ranorex.com/help/latest/ran ... namic-ids/
https://www.ranorex.com/blog/automated- ... namic-ids/
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