Reputation: 1023
This is the output when printing my ${element}
:
I wish to obtain the data of the first child of my ${element}
that has a type: "text"
and data valid duration (hours:minutes:seconds)
. In my case I want to obtain "5:01"
.
However, when trying to obtain all the children using ${element}.children()
I get the following:
Basically there is no data
and no type
which I can check/obtain. What am I doing wrong?
Upvotes: 0
Views: 1620
Reputation: 1383
From the log image I can see children property is an array not a function.
Following Code should get you the desired data.
element.children.find(child => child.type == 'text').data;
Upvotes: 2