Module: TextFieldHelper

Defined in:
lib/watir_helper/textfield_helper.rb

Instance Method Summary collapse

Instance Method Details

#clear_textfield(property, propertyvalue) ⇒ Object

Clear a texfield.



21
22
23
24
# File 'lib/watir_helper/textfield_helper.rb', line 21

def clear_textfield(property,propertyvalue)
  propertyvalue=/#{propertyvalue}/
  $ie.text_field(property.intern,propertyvalue).clear
end

#exists_textfield(property, propertyvalue) ⇒ Object

Check whether a textfield exists or not.



33
34
35
36
# File 'lib/watir_helper/textfield_helper.rb', line 33

def exists_textfield(property,propertyvalue) 
  propertyvalue=/#{propertyvalue}/
  $ie.text_field(property.intern,propertyvalue).exists?
end

#flash_textfield(property, propertyvalue) ⇒ Object

Highlight or Flash a textfield.



27
28
29
30
# File 'lib/watir_helper/textfield_helper.rb', line 27

def flash_textfield(property,propertyvalue)
  propertyvalue=/#{propertyvalue}/
  $ie.text_field(property.intern,propertyvalue).flash
end

#get_textfieldObject

Get the text from the textfield.



12
13
14
15
16
17
18
# File 'lib/watir_helper/textfield_helper.rb', line 12

def get_textfield()
  if $settext.nil?
    return nil
  else
    return $settext
  end
end

#is_blank_textfieldObject

Check whether a textfield is blank or not.



39
40
41
# File 'lib/watir_helper/textfield_helper.rb', line 39

def is_blank_textfield()
  return $settext.nil? ? true : false 
end

#set_textfield(property, propertyvalue, settextvalue) ⇒ Object

Set a texfield with a text.



6
7
8
9
# File 'lib/watir_helper/textfield_helper.rb', line 6

def set_textfield(property,propertyvalue,settextvalue)
  $settext=settextvalue
  $ie.text_field(property.intern,propertyvalue).set settextvalue
end