1

I am doing some webdriver-automation with etaoin, and need to click a button for some tests. I have been able to accomplish with the following javascript code that is run in the browser console, but need to find the equivalent way to query a shadowDom with etaoin.

This code (with actual elements instead of placeholder "some") describes what I am trying to accomplish in etaoin/clojure.

document.querySelector("some-page").shadowRoot.querySelector("some-list").shadowRoot.querySelector("some-div").shadowRoot.querySelector("[data-test=some-status-button]").click()

How can I access/query a shadow dom via etaoin? https://github.com/igrishaev/etaoin lacks the documentation I need.

Answers that describe how to insert the above js code into the developer console and run it via a etaoin webdriver would be acceptable, as would documentation on using etaoin to navigate a virtual mouse in the webdriver to a specific x-y coordinate and clicking at that point would also be acceptable.

CambodianCoder
  • 467
  • 4
  • 14

1 Answers1

2

Read up more on Etaoin documentation, and found a solution that worked for me. Utilize the js-execute function, in connection with your driver and the .ShadowRoot javascript call on an element.

(js-execute driver "document
.querySelector(\"element-id\").shadowRoot.querySelector(\"tag-name\").click()")

See shadowRoot for more info.

CambodianCoder
  • 467
  • 4
  • 14