Custom ID not being displayed by object spy when using Firefox
- 4 years ago
Actually found this from a previous community post, but appreciate the responses.
SmartBear Community response:
Hi,
If I got it right, you are trying to inspect custom attributes of some SPAN element accessed via parentElement property of its child.
The reason you can't see those attributes is that the property returns a native browser object instead of TestComplete extended object. Native browser objects return "raw" attributes and dataset collections, those collections do not list attribute names as properties (see NamedNodeMap and DOMStringMap). For that purpose you need to use TestComplete-specific Parent property instead of the native parentElement (the reason you can successfully use parentElement in Google Chrome is, in fact, an undocumented trait of TestComplete implementation of Chrome support).
Another important thing is that, most likely, you are using parentElement instead of Parent because your SPAN element is not included in TestComplete object tree and, thus, not accessible via Parent. If so, you can either try not to use the SPAN in your tests/NameMapping at all, or, make this SPAN appear in the object tree by adding text content or role attribute to the SPAN (see Web Elements Included in and Excluded From the Tree Model).