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.
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?