How can I interact with this modal dialog using Webdriver & Python? How can I interact with this modal dialog using Webdriver & Python? google-chrome google-chrome

How can I interact with this modal dialog using Webdriver & Python?


This is the python syntax

from selenium.webdriver.remote.webdriver import WebDriverbrowser = WebDriver()# do other stuff herebrowser.switch_to_alert().accept()# continue with other stuff here

The alert api is located in selenium.webdriver.common.alert


The below code is using Java, u can try using the below code converting it to Python syntax. Sorry as I am Webdriver - Java Tester, I can't give you the Python code. Hope this will solve your requirements.

Alert alertDialog = driver.switchTo().alert();//Get the alert textString alertText = alertDialog.getText();//Click the OK button on the alert.alertDialog.accept();

Cheers,

Mahesh