Reputation: 61
Below code is for finding parent. What needs to be passed instead of ".." to access child?
const parent = paragraph.$('..')
console.log(parent.getTagName())
// outputs: "body"
Upvotes: 4
Views: 7901
Reputation: 696
Do you know which elements are you looking for? Check these examples:
paragraph.$$('//*') // find all childs
paragraph.$('a') // find first child link
paragraph.$('*=Submit') // find first child element which contains 'Submit'
You can use any locator strategy as you want - CSS
, XPath
, TagName
or by text
. Check documentation
Upvotes: 4