Forum Discussion
Solved
coffee
Contributor
Thanks for the suggestion :smileyhappy:
I find the solution and tried it directly in Chrome (using native Javascript). It works fine, but unfortunately TC complains that something is not right .
var CSSselector = "#Detail > div > table > tbody"; Page = Sys.Browser('*').Page("http://www.myweb.com"); aqUtils.Delay(5000);
var par = Page.QuerySelectorAll(CSSselector); var child2 = par[0].childNodes[1].childNodes[4]; var finish = child2.querySelector('.validate[value]').getAttribute("value");
Then I found that TC doesn't have method childNodes[i] but Child(i). (https://support.smartbear.com/viewarticle/88401/)
Therefore I changed it to
var child2 = par[0].Child(1).Child(4);
But still TC complains saying "TypeError par[0].Child is not a function".
How to find the n-th child and then the x-th grandchild in TC (and then possible the y-th grand grandchild) and grab it's attribute?
Thank You.
baxatob
8 years agoCommunity Hero
Why do you want to iterate through the child elements, if your target element has an unique id property?
Related Content
- 4 years agoSuperTester
- 4 years agoSuperTester