Class: Sapphire::WebAbstractions::AlertBox

Inherits:
Control show all
Defined in:
lib/sapphire/WebAbstractions/Controls/AlertBox.rb

Instance Attribute Summary

Attributes inherited from Control

#control, #found_by_type, #found_by_value

Instance Method Summary collapse

Methods inherited from Control

#Click, #Contain, #Equals, #Evaluate, #FindAll, #FindWithoutWait, #GetValue, #In, #MouseOver, #Substitute, #Text, #initialize

Constructor Details

This class inherits a constructor from Sapphire::WebAbstractions::Control

Instance Method Details

#AcceptObject



4
5
6
# File 'lib/sapphire/WebAbstractions/Controls/AlertBox.rb', line 4

def Accept
  $driver.AcceptAlert
end

#Find(comparator = nil) ⇒ Object



17
18
19
# File 'lib/sapphire/WebAbstractions/Controls/AlertBox.rb', line 17

def Find(comparator = nil)
  return $driver.FindAlert
end

#Set(text) ⇒ Object



8
9
10
# File 'lib/sapphire/WebAbstractions/Controls/AlertBox.rb', line 8

def Set(text)
  $driver.SetAlert(text)
end

#Visible(shouldWait = true, comparator = nil) ⇒ Object



12
13
14
15
# File 'lib/sapphire/WebAbstractions/Controls/AlertBox.rb', line 12

def Visible(shouldWait = true, comparator = nil)
  return Evaluation.new(comparator.Compare($driver.AlertShown(), true), true) if !comparator.nil?
  Evaluation.new($driver.AlertShown(), true)
end