Class: Selenium::WebDriver::Alert
- Inherits:
-
Object
- Object
- Selenium::WebDriver::Alert
- Defined in:
- lib/selenium/webdriver/common/alert.rb
Instance Method Summary collapse
- #accept ⇒ Object
- #authenticate(username, password) ⇒ Object
- #dismiss ⇒ Object
-
#initialize(bridge) ⇒ Alert
constructor
A new instance of Alert.
- #send_keys(keys) ⇒ Object
- #text ⇒ Object
Constructor Details
#initialize(bridge) ⇒ Alert
Returns a new instance of Alert.
23 24 25 26 27 28 |
# File 'lib/selenium/webdriver/common/alert.rb', line 23 def initialize(bridge) @bridge = bridge # fail fast if the alert doesn't exist bridge.alert_text end |
Instance Method Details
#accept ⇒ Object
30 31 32 |
# File 'lib/selenium/webdriver/common/alert.rb', line 30 def accept @bridge.accept_alert end |
#authenticate(username, password) ⇒ Object
46 47 48 49 |
# File 'lib/selenium/webdriver/common/alert.rb', line 46 def authenticate(username, password) @bridge.authentication(username: username, password: password) accept end |
#dismiss ⇒ Object
34 35 36 |
# File 'lib/selenium/webdriver/common/alert.rb', line 34 def dismiss @bridge.dismiss_alert end |
#send_keys(keys) ⇒ Object
38 39 40 |
# File 'lib/selenium/webdriver/common/alert.rb', line 38 def send_keys(keys) @bridge.alert = keys end |
#text ⇒ Object
42 43 44 |
# File 'lib/selenium/webdriver/common/alert.rb', line 42 def text @bridge.alert_text end |