Class: Selenium::WebDriver::Alert

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

Instance Method Summary collapse

Constructor Details

#initialize(bridge) ⇒ Alert

Returns a new instance of Alert



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

def initialize(bridge)
  @bridge = bridge

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

Instance Method Details

#acceptObject



28
29
30
# File 'build/rb/lib/selenium/webdriver/common/alert.rb', line 28

def accept
  @bridge.accept_alert
end

#dismissObject



32
33
34
# File 'build/rb/lib/selenium/webdriver/common/alert.rb', line 32

def dismiss
  @bridge.dismiss_alert
end

#send_keys(keys) ⇒ Object



36
37
38
# File 'build/rb/lib/selenium/webdriver/common/alert.rb', line 36

def send_keys(keys)
  @bridge.alert = keys
end

#textObject



40
41
42
# File 'build/rb/lib/selenium/webdriver/common/alert.rb', line 40

def text
  @bridge.alert_text
end