Forum Discussion
Hi baxatob ,
That one is dynamically created , so not static.
Also I have other cases where there is completely no ID.
I tried that code in Chrome and it works perfectly fine, so Javascript-syntax-wise should be all right. Not sure why TC doesn't like it.
Thank You.
- baxatob8 years agoCommunity Hero
Try to iterate using:
...querySelector(CSS_selector).children.item(index). ... .textContent
- coffee8 years agoContributor
Thank you very much baxatob
The solution does work. :smileyhappy:
I am just wondering why TC use different method than native Javascript.
Is there any article/documentation about children.item(i)? Just want to dig further about this method and how TC explore the DOM. I assume there are other methods that TC uses differently than the native Javascript? Thanks.
- HKosova8 years agoSmartBear Alumni (Retired)
Hi coffee,
Just out of curiosity, why don't you search for the target INPUT object directly? Doesn't it have some combination of properties that make it unique? For example:
var obj = Page.QuerySelector("input.validate[type='hidden']"); Log.Message(obj.value);
Related Content
- 4 years agoSuperTester
- 4 years agoSuperTester
Recent Discussions
- 7 hours agojstaehlin
- 24 hours agoAivanitskiy