zmc
2023-12-22 9fdbf60165db0400c2e8e6be2dc6e88138ac719a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
U
[±dР   ã@s.dZddlmZddlmZGdd„dƒZdS)zThe Alert implementation.é)Úkeys_to_typing)ÚCommandc@s<eZdZdZdd„Zedd„ƒZdd„Zdd    „Zd
d „Z    d S) ÚAlertaeAllows to work with alerts.
 
    Use this class to interact with alert prompts.  It contains methods for dismissing,
    accepting, inputting, and getting text from alert prompts.
 
    Accepting / Dismissing alert prompts::
 
        Alert(driver).accept()
        Alert(driver).dismiss()
 
    Inputting a value into an alert prompt:
 
        name_prompt = Alert(driver)
        name_prompt.send_keys("Willian Shakesphere")
        name_prompt.accept()
 
 
    Reading a the text of a prompt for verification:
 
        alert_text = Alert(driver).text
        self.assertEqual("Do you wish to quit?", alert_text)
    cCs
||_dS)ztCreates a new Alert.
 
        :Args:
         - driver: The WebDriver instance which performs user actions.
        N)Údriver)Úselfr©rúVd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\selenium/webdriver/common/alert.pyÚ__init__0szAlert.__init__cCs|j tj¡dS)zGets the text of the Alert.Úvalue)rÚexecuterZW3C_GET_ALERT_TEXT©rrrrÚtext8sz
Alert.textcCs|j tj¡dS)zDismisses the alert available.N)rr rZW3C_DISMISS_ALERTr rrrÚdismiss=sz Alert.dismisscCs|j tj¡dS)zoAccepts the alert available.
 
        Usage::
        Alert(driver).accept() # Confirm a alert dialog.
        N)rr rZW3C_ACCEPT_ALERTr rrrÚacceptAsz Alert.acceptcCs|j tjt|ƒ|dœ¡dS)zeSend Keys to the Alert.
 
        :Args:
         - keysToSend: The text to be sent to Alert.
        )r
r N)rr rZW3C_SET_ALERT_VALUEr)rZ
keysToSendrrrÚ    send_keysIszAlert.send_keysN)
Ú__name__Ú
__module__Ú __qualname__Ú__doc__r    Úpropertyr rrrrrrrrs
rN)rZselenium.webdriver.common.utilsrZ!selenium.webdriver.remote.commandrrrrrrÚ<module>s