The bullet boxes mainly include the following:
alert box
The confirm bullet box and the alert bullet box add a cancel button
The prompt bullet box and the alert bullet box have added confirmation content
Today we mainly solve the confirm bullet box, bullet box
method one
options=webdriver.IeOptions()
options.ignore_protected_mode_settings=True
options.binary_location=r'D:\Program Files\360\360se6\Application\360se.exe'
driver=webdriver.Ie(executable_path="D:\Python\Python36\IEDriverServer.exe",options=options)
driver.get("http://10.0.0.1:9080/")
confirmAlert=driver.switch_to_alert();
confirmAlert.accept()#Click OK
confirmAlert.dismiss()#Click to cancel
Method Two:
from selenium.webdriver.common.alert import Alert
options=webdriver.IeOptions()
options.ignore_protected_mode_settings=True
options.binary_location=r'D:\Program Files\360\360se6\Application\360se.exe'
driver=webdriver.Ie(executable_path="D:\Python\Python36\IEDriverServer.exe",options=options)
driver.get("http://10.0.0.1:9080/")
confirmAlert=Alert(driver)
confirmAlert.dismiss()#Click OK
#confirmAlert.accept()#Click to cancel