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 properties, but only when I'm using Chrome.
If I use Firefox, the custom data attribute, is not listed under either the "attributes" or "dataset" properties. I can see the custom attribute if I view the text of the OuterHTML property of the object , so I think I'm at the right level in the object tree (I'm viewing the parentelement of the onscreen object)
Any ideas on how/if the custom data attribute can appear under either the "attributes" or "dataset" object properties? when using Firefox?
Thanks in advance
Tom.
Hi,
In this case I would double-check that Firefox settings are set as required by https://support.smartbear.com/testcomplete/docs/app-testing/web/general/preparing-browsers/firefox.html (this is because I seem to note that they might be altered by some Windows update or something else) and create Support case via https://support.smartbear.com/message/?prod=TestComplete if it does not help.
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.