Automatic updates for XPATH element in automation

Currently I’m running tests on a system that creates packs, with each pack having a specific ID number tied to it. After a pack has been created while using the recorder then running the automation test, the test will fail as the XPATH used to access the new pack will be set to the previous report I created as part of the recording process. Is there any way the XPATH element can update itself to recognise a new value being added on the page so it can be opened, or would I need to edit it manually each time a test is ran?

Hi @Patrick.

You can achieve that by making your custom locator.

Please follow this article:

Mastering element locating techniques and relative Xpath writing skill

A complete practical guide for writing correct Xpath in any situation

This one can also be helpful:

Let me know if you still need any help :slight_smile: