Am trying to click a checkbox on a selenium pop up (looks like a javascript or so ?), and then an Open/Cancel button.
I tried browser.switch_to.alert() and a few other things, but failed to handle.
browser.switch_to.alert() Traceback (most recent call last): File "", line 1, in File "C:\Users\saleh\PycharmProjects\LearnPythonSaleh\venv\lib\site-packages\selenium\webdriver\remote\switch_to.py", line 55, in alert alert.text File "C:\Users\saleh\PycharmProjects\LearnPythonSaleh\venv\lib\site-packages\selenium\webdriver\common\alert.py", line 67, in text return self.driver.execute(Command.W3C_GET_ALERT_TEXT)["value"] File "C:\Users\saleh\PycharmProjects\LearnPythonSaleh\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute self.error_handler.check_response(response) File "C:\Users\saleh\PycharmProjects\LearnPythonSaleh\venv\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.NoAlertPresentException: Message: no such alert (Session info: chrome=94.0.4606.81)
Appreciate any help on this... thanks
Aucun commentaire:
Enregistrer un commentaire