For dynamic web pages like yours, it really helps to get familiar with the pageās HTML DOM and understand how element attributes change. TestCompleteās Object Spy and Object Browser are great tools, but I usually use the browserās Developer Tools (F12) or Inspect Element to copy the full XPath before and after a page change ā that makes it easy to also see which parts of the path are dynamic.
Try to avoid using dynamic values wherever possible. When you canāt, use wildcards or regular expressions in your Name Mapping, or with the FindChild() and FindAllChildren() methods.
One effective approach is to anchor your XPath to a stable ancestor element and use the contains() function. For example:
/html/body/div[3]/div[2]/div[5]/span[@id='textnode17']
can be rewritten as:
//div[@class='content-panel']//span[contains(@id, 'textnode')]
By referencing a stable ancestor and using partial matching, your test objects remain more resilient to changes in dynamic identifiers.
š¤ AI-assisted response
š Found it helpful? Click Like
ā
Issue resolved? Click Mark as Solution