Nightwatch execute not handling nested shadow roots #2692
-
Hit a wall with this one. Writing a simple login test but the fields are nested within several shadow root components. I can run the following js in the browser console to drill into each root and locate the element, which is ugly but works fine...
My issue is in trying to transplant this into Nightwatch's execute command to run during the test, which looks like this...
Running this will return error Error while running .executeScript() protocol action: An error occurred while executing user supplied JavaScript. – javascript error: Cannot read property 'shadowRoot' of null The execute doesn't seem to be able to handle multiple .querySelector because if I remove every instance except for the first .querySelector('sign-in').shadowRoot then it returns the element ID successfully. Does anyone know how else this js could be wrapped to avoid this apparent limitation? In summary, this works...
This doesn't
and I don't know why :( |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I got this to work by extending the globalTimeout though i'm not sure how this impacts the command, i've a feeling that executeAysnc may have worked but haven't yet looked into it. |
Beta Was this translation helpful? Give feedback.
I got this to work by extending the globalTimeout though i'm not sure how this impacts the command, i've a feeling that executeAysnc may have worked but haven't yet looked into it.