Module: Async::WebDriver::Scope::Alerts

Included in:
Element, Async::WebDriver::Session
Defined in:
lib/async/webdriver/scope/alerts.rb

Overview

Helpers for working with alerts.

“‘ ruby session.dismiss_alert session.accept_alert session.alert_text session.set_alert_text(“Hello, World!”) “`

Instance Method Summary collapse

Instance Method Details

#accept_alertObject

Accept the current alert.



24
25
26
# File 'lib/async/webdriver/scope/alerts.rb', line 24

def accept_alert
  session.post("alert/accept")
end

#alert_textObject

Get the text of the current alert.



29
30
31
# File 'lib/async/webdriver/scope/alerts.rb', line 29

def alert_text
  session.get("alert/text")
end

#dismiss_alertObject

Dismiss the current alert.



19
20
21
# File 'lib/async/webdriver/scope/alerts.rb', line 19

def dismiss_alert
  session.post("alert/dismiss")
end

#set_alert_text(text) ⇒ Object

Set the text input of the current alert.



34
35
36
# File 'lib/async/webdriver/scope/alerts.rb', line 34

def set_alert_text(text)
  session.post("alert/text", {text: text})
end