-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Labels
Description
Have you read the Contributing Guidelines on issues?
- I have read the Contributing Guidelines on issues.
WebdriverIO Version
latest
Node.js Version
16.15
Mode
Standalone Mode
Which capabilities are you using?
{
maxInstances: 4,
browserName: 'chrome',
acceptInsecureCerts: true,
},What happened?
the new API for shadow : #9911 broke the function
The element in shadow root is correctly found by the API then the findElementsFromElement command is called with elementId from shadowRoot : 0cc82a02-c2c9-4ceb-a22e-af36d8756b31 when it shouldn't. findElementFromElement can't find an element in a shadowRoot
Please see logs:
[0-0] 2023-03-24T08:51:38.740Z INFO webdriver: COMMAND getElementShadowRoot("0cc82a02-c2c9-4ceb-a22e-af36d8756b31")
[0-0] 2023-03-24T08:51:38.741Z INFO webdriver: [GET] http://localhost:9515/session/c114180a29f1df706c4af2ed98626628/element/0cc82a02-c2c9-4ceb-a22e-af36d8756b31/shadow
[0-0] 2023-03-24T08:51:38.754Z INFO webdriver: RESULT {
[0-0] 'shadow-6066-11e4-a52e-4f735466cecf': '4e0b95e9-f041-44fe-a905-adfd4f5423f1'
[0-0] }
[0-0] 2023-03-24T08:51:38.754Z INFO webdriver: COMMAND findElementFromShadowRoot("4e0b95e9-f041-44fe-a905-adfd4f5423f1", "css selector", "button")
[0-0] 2023-03-24T08:51:38.755Z INFO webdriver: [POST] http://localhost:9515/session/c114180a29f1df706c4af2ed98626628/shadow/4e0b95e9-f041-44fe-a905-adfd4f5423f1/element
[0-0] 2023-03-24T08:51:38.755Z INFO webdriver: DATA { using: 'css selector', value: 'button' }
[0-0] 2023-03-24T08:51:38.774Z INFO webdriver: RESULT {
[0-0] 'element-6066-11e4-a52e-4f735466cecf': '3cb72342-c9ff-4068-95bb-b5b6eb678f1a'
[0-0] }
[0-0] 2023-03-24T08:51:38.777Z INFO webdriver: COMMAND findElementsFromElement("0cc82a02-c2c9-4ceb-a22e-af36d8756b31", "css selector", "button")
[0-0] 2023-03-24T08:51:38.778Z INFO webdriver: [POST] http://localhost:9515/session/c114180a29f1df706c4af2ed98626628/element/0cc82a02-c2c9-4ceb-a22e-af36d8756b31/elements
[0-0] 2023-03-24T08:51:38.778Z INFO webdriver: DATA { using: 'css selector', value: 'button' }
[0-0] 2023-03-24T08:51:38.800Z INFO webdriver: RESULT []
What is your expected behavior?
I think it should replace this line in the code by other thing.
I want to correct it but I have not idea how.
How to reproduce the bug.
To reproduce:
https://github.com/lacell75/cucumber-boilerplate/tree/shadowIssue
node wdio wdio.BUILD.conf.ts --spec src\features\shadowIssue.feature
or this code:
await browser.url('https://taskmob.demo.vaadin.com');
await $('>>>#newTaskButton').waitForDisplayed();
console.log(await $('>>>#newTaskButton button').isExisting()); // return true
const element = $('tasks-view').shadow$('#newTaskButton').shadow$('button');
console.log(await element.isExisting()); // return false
await expect(element).toBeExisting();
Relevant log output
[0-0] 2023-03-24T08:51:38.642Z INFO webdriver: COMMAND findElement("css selector", "tasks-view")
[0-0] 2023-03-24T08:51:38.642Z INFO webdriver: [POST] http://localhost:9515/session/c114180a29f1df706c4af2ed98626628/element
[0-0] 2023-03-24T08:51:38.642Z INFO webdriver: DATA { using: 'css selector', value: 'tasks-view' }
[0324/095138.654:INFO:CONSOLE(1)] "Fri Mar 24 2023 09:51:38 GMT+0100 (heure normale dÔÇÖEurope centrale) Atmosphere: websocket.onopen", source: https://taskmob.demo.vaadin.com/VAADIN/static/push/vaadinPush-min.js?v=2.1.6 (1)
[0324/095138.654:INFO:CONSOLE(1)] "Websocket successfully opened", source: https://taskmob.demo.vaadin.com/VAADIN/static/push/vaadinPush-min.js?v=2.1.6 (1)
[0324/095138.655:INFO:CONSOLE(1)] "Fri Mar 24 2023 09:51:38 GMT+0100 (heure normale dÔÇÖEurope centrale) Atmosphere: websocket.onmessage", source: https://taskmob.demo.vaadin.com/VAADIN/static/push/vaadinPush-min.js?v=2.1.6 (1)
[0324/095138.656:INFO:CONSOLE(1)] "Fri Mar 24 2023 09:51:38 GMT+0100 (heure normale dÔÇÖEurope centrale) Atmosphere: Firing onOpen", source: https://taskmob.demo.vaadin.com/VAADIN/static/push/vaadinPush-min.js?v=2.1.6 (1)
[0324/095138.657:INFO:CONSOLE(1)] "Fri Mar 24 2023 09:51:38 GMT+0100 (heure normale dÔÇÖEurope centrale) Atmosphere: Firing onOpen", source: https://taskmob.demo.vaadin.com/VAADIN/static/push/vaadinPush-min.js?v=2.1.6 (1)
[0-0] 2023-03-24T08:51:38.685Z INFO webdriver: RESULT {
[0-0] 'element-6066-11e4-a52e-4f735466cecf': 'cba7660a-36ec-4904-bb88-ee32ce9a21e1'
[0-0] }
[0-0] 2023-03-24T08:51:38.694Z INFO webdriver: COMMAND getElementShadowRoot("cba7660a-36ec-4904-bb88-ee32ce9a21e1")
[0-0] 2023-03-24T08:51:38.695Z INFO webdriver: [GET] http://localhost:9515/session/c114180a29f1df706c4af2ed98626628/element/cba7660a-36ec-4904-bb88-ee32ce9a21e1/shadow
[0-0] 2023-03-24T08:51:38.711Z INFO webdriver: RESULT {
[0-0] 'shadow-6066-11e4-a52e-4f735466cecf': 'e32ce329-5c6c-46b6-b3aa-d8b615b9db56'
[0-0] }
[0-0] 2023-03-24T08:51:38.712Z INFO webdriver: COMMAND findElementFromShadowRoot("e32ce329-5c6c-46b6-b3aa-d8b615b9db56", "css selector", "#newTaskButton")
[0-0] 2023-03-24T08:51:38.713Z INFO webdriver: [POST] http://localhost:9515/session/c114180a29f1df706c4af2ed98626628/shadow/e32ce329-5c6c-46b6-b3aa-d8b615b9db56/element
[0-0] 2023-03-24T08:51:38.713Z INFO webdriver: DATA { using: 'css selector', value: '#newTaskButton' }
[0-0] 2023-03-24T08:51:38.737Z INFO webdriver: RESULT {
[0-0] 'element-6066-11e4-a52e-4f735466cecf': '0cc82a02-c2c9-4ceb-a22e-af36d8756b31'
[0-0] }
[0-0] 2023-03-24T08:51:38.740Z INFO webdriver: COMMAND getElementShadowRoot("0cc82a02-c2c9-4ceb-a22e-af36d8756b31")
[0-0] 2023-03-24T08:51:38.741Z INFO webdriver: [GET] http://localhost:9515/session/c114180a29f1df706c4af2ed98626628/element/0cc82a02-c2c9-4ceb-a22e-af36d8756b31/shadow
[0-0] 2023-03-24T08:51:38.754Z INFO webdriver: RESULT {
[0-0] 'shadow-6066-11e4-a52e-4f735466cecf': '4e0b95e9-f041-44fe-a905-adfd4f5423f1'
[0-0] }
[0-0] 2023-03-24T08:51:38.754Z INFO webdriver: COMMAND findElementFromShadowRoot("4e0b95e9-f041-44fe-a905-adfd4f5423f1", "css selector", "button")
[0-0] 2023-03-24T08:51:38.755Z INFO webdriver: [POST] http://localhost:9515/session/c114180a29f1df706c4af2ed98626628/shadow/4e0b95e9-f041-44fe-a905-adfd4f5423f1/element
[0-0] 2023-03-24T08:51:38.755Z INFO webdriver: DATA { using: 'css selector', value: 'button' }
[0-0] 2023-03-24T08:51:38.774Z INFO webdriver: RESULT {
[0-0] 'element-6066-11e4-a52e-4f735466cecf': '3cb72342-c9ff-4068-95bb-b5b6eb678f1a'
[0-0] }
[0-0] 2023-03-24T08:51:38.777Z INFO webdriver: COMMAND findElementsFromElement("0cc82a02-c2c9-4ceb-a22e-af36d8756b31", "css selector", "button")
[0-0] 2023-03-24T08:51:38.778Z INFO webdriver: [POST] http://localhost:9515/session/c114180a29f1df706c4af2ed98626628/element/0cc82a02-c2c9-4ceb-a22e-af36d8756b31/elements
[0-0] 2023-03-24T08:51:38.778Z INFO webdriver: DATA { using: 'css selector', value: 'button' }
[0-0] 2023-03-24T08:51:38.800Z INFO webdriver: RESULT []
[0-0] false
### Code of Conduct
- [X] I agree to follow this project's Code of Conduct
### Is there an existing issue for this?
- [X] I have searched the existing issues
Reactions are currently unavailable