How get Kantu to work with dynamic ID's


#1

I have a large ember.js web site and need to produce tests quickly using kantu. Unfortunately when playing back my recordings they fail because ember.js use of dynamic id’s. How can I fix the issue?


Id tag has different values - how can I still click it?
Extracting the variable from the website
How to choose id NOT by unique ID in kantu?
Dynamic button names
#2

I had the same issue, but the FAQ answers it:

How to click a button with a changing ID (partial ID match)?

On some websites the ID of a button (or an element in general) is changing between different page loads (dynamic 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-’)].

See here https://a9t9.com/kantu/docs/webextensions/selenium-ide/click#changingid


Id and target changes eveytime a page is refreshed