cancel
Showing results for 
Search instead for 
Did you mean: 

Html 5 custom data attribute on Firefox

SOLVED
ThomasCasserly
Contributor

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.

2 ACCEPTED SOLUTIONS

Accepted Solutions
AlexKaras
Community Hero

Re: Html 5 custom data attribute on Firefox

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.h... (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.

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================

View solution in original post

UnveN
Staff

Re: Html 5 custom data attribute on Firefox

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.

Stanislav
SmartBear Developer

View solution in original post

10 REPLIES 10
cunderw
Community Hero

Re: Html 5 custom data attribute on Firefox

Which version of firefox are you using? Seems to be working just fine for me. 


Thanks,
Carson

Click the Accept as Solution button if my answer has helped
ThomasCasserly
Contributor

Re: Html 5 custom data attribute on Firefox

I've got Firefox version 62.0.2

tristaanogre
Community Hero

Re: Html 5 custom data attribute on Firefox

Have you made sure you've downloaded the latest Firefox updates for TestComplet?


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
ThomasCasserly
Contributor

Re: Html 5 custom data attribute on Firefox

Pretty sure I have, upgraded to version 12.60 on Monday this week and there was a Firefox update as part of that, but I'll double check and run the "Check for updates" function.

ThomasCasserly
Contributor

Re: Html 5 custom data attribute on Firefox

So i verified there were no updates available for my TestComplete version, then went further and uninstalled and reinstalled the full prouct and am still seeing the same issue with custom data attributes not being displayed under "attributes" or "dataset" object property items.

AlexKaras
Community Hero

Re: Html 5 custom data attribute on Firefox

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.h... (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.

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================

View solution in original post

ThomasCasserly
Contributor

Re: Html 5 custom data attribute on Firefox

Ok Alex I will give that a try.

 

Thanks.

UnveN
Staff

Re: Html 5 custom data attribute on Firefox

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.

Stanislav
SmartBear Developer

View solution in original post

AlexKaras
Community Hero

Re: Html 5 custom data attribute on Firefox

Great reply from Stanislav!

 

To Community: It looks like that we need to add the "How exactly this web element was obtained?" question to the check-list questionnairie.

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors