Forum Discussion

ThomasCasserly's avatar
ThomasCasserly
Frequent Contributor
6 years ago
Solved

Html 5 custom data attribute on Firefox

Hi all,    So this links to my other recent post about HTML 5 custom data attributes. I can now view custom attributes, they appear listed under either the "attributes" or "dataset" object proper...
  • UnveN's avatar
    6 years ago

    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).

     

    Hope this helps.