Forum Discussion

googleid_114358's avatar
googleid_114358
Contributor
12 years ago

HTML5 data-* properties unavailable

Hi.



Our dev team started to use HTML5 data property and I would like to access those values with TestComplete. Here is the W3C description http://www.w3.org/TR/html5/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes



Here is an example of the html page source code : 


 


<TH class=ui-state-default data-type="string" data-property="updateAction" jQuery18307259154879304706="60"></TH>



I want to be able to access the data-property of the HTMLCell.



I have been through TestComplete documentation to understand why I can't see any of those specific properties within the objet browser and could not find any answer.



So far, the best I can do is to search in the innerHtml property but this is not safe enough. I wonder if you are planning to support those properties...



I don't think it might be a browser version issue. I tried this with IExplore 9 and Chrome 28. According to http://html5test.com/compare/feature/elements-dataset.html Chrome support the feature and still, TestComplete will not show me anything interesting.



Regards, 



Guillaume.
  • The w3.org page that you specified contains definition of dataset property, which is intended to access these data-attributes, but it does not work in IE. If you need cross-browser way then you should use getAttribute method of a web element of interest:



    Log.Message(THobj.getAttribute("data-property"))
  • The w3.org page that you specified contains definition of dataset property, which is intended to access these data-attributes, but it does not work in IE. If you need cross-browser way then you should use getAttribute method of a web element of interest:



    Log.Message(THobj.getAttribute("data-property"))