mirror of
https://gitee.com/g1879/DrissionPage.git
synced 2024-12-10 04:00:23 +08:00
微调
This commit is contained in:
parent
61bb2ac0df
commit
2ea60172ac
@ -236,14 +236,14 @@ class DriverPage(object):
|
||||
:return:
|
||||
"""
|
||||
try:
|
||||
alertObject = self.driver.switch_to.alert
|
||||
alert = self.driver.switch_to.alert
|
||||
except NoAlertPresentException:
|
||||
return None
|
||||
if text:
|
||||
alertObject.send_keys(text)
|
||||
text = alertObject.text
|
||||
alert.send_keys(text)
|
||||
text = alert.text
|
||||
if mode == 'cancel':
|
||||
alertObject.dismiss()
|
||||
alert.dismiss()
|
||||
elif mode == 'ok':
|
||||
alertObject.accept()
|
||||
alert.accept()
|
||||
return text
|
||||
|
Loading…
x
Reference in New Issue
Block a user