Class: SK::Field

Inherits:
Element show all
Defined in:
lib/field.rb

Instance Attribute Summary

Attributes inherited from Element

#el, #locator

Instance Method Summary collapse

Methods inherited from Element

#children, #displayed?, #enabled?, #exists?, #find, #find_child_el, #html, #parent_el, #search, #text, #to_s

Constructor Details

#initialize(locator) ⇒ Field

Returns a new instance of Field.



3
4
5
# File 'lib/field.rb', line 3

def initialize(locator)
  super(locator) # creates the el and locator
end

Instance Method Details

#set(value) ⇒ Object



7
8
9
10
11
12
13
14
# File 'lib/field.rb', line 7

def set(value)
  if self.el
    self.el.clear
    self.el.send_keys(value)
  else
    SK::Trace.error "SK::Field.set: element not initialized for #{locator}"
  end
end