Forum Discussion

lgonzagi's avatar
lgonzagi
Occasional Contributor
9 months ago
Solved

Can TestComplete Name Mapping Identify Multiple Web Elements?

I'm working with TestComplete and trying to use Name Mapping to identify multiple web elements that match a given selector. However, when I paste a selector that finds multiple elements in the Name M...
  • scottroutesmart's avatar
    9 months ago

    You would probably be better off using a function like FindElements() to identify the matching objects.  The result is an array of those objects so you can then get the length to know how many matches exist, or get the individual objects and iterate through them.

    https://support.smartbear.com/testcomplete/docs/reference/test-objects/members/page/findelements-method-page-object.html

    Be sure to use the plural findelements() instead of the singular findelement() which will only return the first match.