TestComplete name mapping to map xpath with ID
Is there any way that TestComplete will map the object automatically with ID instead of other criteria as even though the object has a unique id but most of the time TestComplete maps it automatically with other criteria like value, class, type as below.
I want to map with ID then with name if that is available as due to above mapping structure most of the time other button also get mapped under same type or class.
As you can see below xpath with id already there for button display data but it has mapped with value and type which causes object not found issue or performance issues.
//*[@id="ctl00_MainContent_btnShowData_input"]
When generating Name Mapping, TestComplete evaluates attributes based on stability and uniqueness. Here's a stable ID having 120 characters,
Dynamic looking ID such as "ctl00_btnShowData", TestComplete may decide that it's auto generated or may change between runs and therefore not reliable. So it avoids using it, and instead chooses alternative selectors it considers more stable.
Read Object Identification to get a better insight.