Closed alebx closed 2 years ago
@alebx thanks for reporting!
Can you explain what happens here:
await table.element(by.className('datatable-header')).all(by.className('datatable-header-cell-label'))).click();
is it clicking on all elements it finds?
@christian-bromann thanks for the quick reply! Yes, that's exactly what's happening. I know I could rewrite the selector, but that would mean a major rewrite of our code base.
So WebdriverIO with the latest version allows you to click on specific elements, e.g.:
await table.$(".datatable-header").$$(".datatable-header-cell-label")[0].click();
but it won't click on all elements. You would need to iterate over them, e.g.:
await for (const elem of table.$(".datatable-header").$$(".datatable-header-cell-label")) {
await elem.click()
}
I think this issue is resolved. Closing.
When transforming this chained selector:
It turns into this:
Which isn't a valid async selector.