Class: Selenium::WebDriver::Alert

Inherits:
Object
  • Object
show all
Defined in:
lib/selenium/webdriver/common/alert.rb

Instance Method Summary collapse

Constructor Details

#initialize(bridge) ⇒ Alert

Returns a new instance of Alert.


5
6
7
8
9
10
# File 'lib/selenium/webdriver/common/alert.rb', line 5

def initialize(bridge)
  @bridge = bridge

  # fail fast if the alert doesn't exist
  bridge.getAlertText
end

Instance Method Details

#acceptObject


12
13
14
# File 'lib/selenium/webdriver/common/alert.rb', line 12

def accept
  @bridge.acceptAlert
end

#dismissObject


16
17
18
# File 'lib/selenium/webdriver/common/alert.rb', line 16

def dismiss
  @bridge.dismissAlert
end

#send_keys(keys) ⇒ Object


20
21
22
# File 'lib/selenium/webdriver/common/alert.rb', line 20

def send_keys(keys)
  @bridge.setAlertValue keys
end

#textObject


24
25
26
# File 'lib/selenium/webdriver/common/alert.rb', line 24

def text
  @bridge.getAlertText
end