Class: Sapphire::WebAbstractions::TextBox

Inherits:
Control show all
Defined in:
lib/sapphire/WebAbstractions/Controls/TextBox.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, #Find, #FindAll, #FindWithoutWait, #GetValue, #In, #MouseOver, #Substitute, #Visible, #initialize

Constructor Details

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

Instance Method Details

#ClearObject



28
29
30
31
# File 'lib/sapphire/WebAbstractions/Controls/TextBox.rb', line 28

def Clear
  textBox = self.Find
  textBox.clear
end

#Set(value) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/sapphire/WebAbstractions/Controls/TextBox.rb', line 15

def Set(value)
  if(value == "")
    self.Clear
  else
    textBox = self.Find
    readonly = textBox.attribute("readonly")
    if readonly == "false" or readonly.nil?
      textBox.clear
    end
    textBox.send_keys value
  end
end

#TextObject



10
11
12
13
# File 'lib/sapphire/WebAbstractions/Controls/TextBox.rb', line 10

def Text
  textBox = self.Find
  textBox.attribute("value")
end

#Text=(value) ⇒ Object



5
6
7
8
# File 'lib/sapphire/WebAbstractions/Controls/TextBox.rb', line 5

def Text= (value)
  textBox = self.Find
  textBox.send_keys value
end