1

I am trying to emulate a shutter click on a camera plugin on angular called @capacitory/angular.

Here's what the HTML looks like when inspected.

Image

This is how I am trying to fetch it in python selenium

Option 1:

shutter = driver.execute_script("return document.querySelector('pwa-camera-modal-instance').shadowRoot.querySelector('pwa-camera')")
shutter.execute_script("document.getElementByClassName('shutter').click();")

Option 2:

shutter = driver.execute_script("return document.querySelector('pwa-camera-modal-instance').shadowRoot.querySelector('pwa-camera')")
shutter.find_element_by_class_name("shutter").click()

If I am able to find how to fetch it I might be also be able to also click the save icon here icon

However, the following didnt work. So i am not able to get the click the shutter and save the photo. Really need this to have coverage on uploading pictures.

I already referred to this source: Does anybody know how to identify shadow dom web elements using selenium webdriver?

johnborges
  • 2,422
  • 20
  • 33
GuraShak
  • 25
  • 5
  • Does this answer your question? [Accessing elements in the shadow DOM](https://stackoverflow.com/questions/28911799/accessing-elements-in-the-shadow-dom) – johnborges Jan 18 '21 at 16:16

0 Answers0