Replies: 1 comment 2 replies
-
|
I am able to fetch these list elements with the following script: const driver = await remote({
capabilities: { browserName: 'chrome' }
})
await driver.url('http://localhost:8080/')
const listElemenst = driver.$('x-user').$$('li')
console.log(await listElemenst.map((el) => el.getText()))
await driver.deleteSession()Note: see how I split the selector into 2 element calls because |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello all, I have a selector thats not working with the version 9 of WebdriverIo. Before, I could get all elements of 'li' in $$('x-user li') adding the deepSelector '>>>', where 'x-user' is an shadow element . But now, if I do not add the deepSelector, the result is an empty array without li elements. ref: https://webdriver.io/docs/selectors/#deep-selectors, 'Starting with v9 of WebdriverIO there is no need for this special selector as WebdriverIO automatically pierces through the Shadow DOM for you. It is recommended to migrate off this selector by removing the >>> in front it.'
this is the html, what I want is get all the 'li' elements inside in version 9 without the deepselector '>>>', with $$(x-user li)
thanks!
Beta Was this translation helpful? Give feedback.
All reactions