Every time I try to record this though the changes.

On some websites the ID of a button (or an element in general) is changing between different page loads ( ID). This means the test case macro will fail at replay as the button has a new ID after each page refresh.

Solution: Typically some part of the ID remains constant e. g. post-123456 and post-555555. We can use XPath’s starts-with or contains functions to search just for the stable part of the ID. So the selector will be something like this: //*[contains(@id, ‘post-‘)].

Source link https://sqa.stackexchange.com/questions/11717/---an--from---when-the-id-is-dynamic


Please enter your comment!
Please enter your name here