I am running an app in the browser; and for some actions I was able to simulate actions with keystrokes; but I have a peculiar problem: some actions in my app cause system promp
If you are talking about system dialogs, then it's not possible to interact with them using selenium.
However, for browser popups (alerts), just navigate to the popup:
driver.switch_to_alert()
Then, use the methods from the Alert
class to interact with the popup. The Alert
class contains methods for dismissing, accepting, inputting, and getting text from alert prompts.
Some examples:
Alert(driver).accept()
Alert(driver).dismiss()
Alert(driver).authenticate()
Alert(driver).send_keys(keys_to_send)
Alert(driver).text()
see: https://seleniumhq.github.io/selenium/docs/api/py/webdriver/selenium.webdriver.common.alert.html