Forum Discussion
Try to iterate using:
...querySelector(CSS_selector).children.item(index). ... .textContent
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);
- baxatob8 years agoCommunity Hero
children property (as well as the item() method) - also native JavaScript, you can find more here >>
- coffee8 years agoContributor
Thank You HKosova , your solution also works fine. But sometimes it can be difficult to QuerySelector if the properties are not unique and can't be made unique. Anyway, having more than one working methods would always be good :) Thanks.
HKosova wrote: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