vendor/gems/gems/firewatir-1.2.1/htmlelements.rb
# 
# Description:
#   Used to set the value of text box and fires the event onKeyPress, onKeyDown, onKeyUp after each character.
#   Shouldnot be used externally. Used internally by set and append methods.
#
# Input:
#   - value - The string to enter into the text field
#

Used to set the value of text box and fires the event onKeyPress, onKeyDown, onKeyUp after each character.
Shouldnot be used externally. Used internally by set and append methods.

The string to enter into the text field
Used to set the value of text box and fires the event onKeyPress onKeyDown onKeyUp after each character . Shouldnot be used externally . Used internally by set and append methods . The string to enter into the text field
def doKeyPress( value )
        begin
            maxLength = @o.maxLength
            if (maxLength != -1 && value.length > maxLength)
                original_value = value
                value = original_value[0..maxLength]
                element.log " Supplied string is #{suppliedValue.length} chars, which exceeds the max length (#{maxLength}) of the field. Using value: #{value}"
            end
        rescue
            maxLength = -1
        end
        for i in 0..value.length-1   
            c = value[i,1]
            @o.value = "#{(@o.value.to_s + c)}"   
            @o.fireEvent("onKeyDown")
            @o.fireEvent("onKeyPress")
            @o.fireEvent("onKeyUp")
        end
    end
def doKeyPress ( value ) begin maxLength = @o . maxLength if ( maxLength != - 1 && value . length > maxLength ) original_value = value value = original_value [ 0 .. maxLength ] element . log " Supplied string is #{suppliedValue.length} chars, which exceeds the max length (#{maxLength}) of the field. Using value: #{value}" end rescue maxLength = - 1 end for i in 0 .. value . length - 1 c = value [ i , 1 ] @o . value = "#{(@o.value.to_s + c)}" @o . fireEvent ( "onKeyDown" ) @o . fireEvent ( "onKeyPress" ) @o . fireEvent ( "onKeyUp" ) end end
Description:
Used to set the value of text box and fires the event onKeyPress, onKeyDown, onKeyUp after each character.
Description : Used to set the value of text box and fires the event onKeyPress onKeyDown onKeyUp after each character .
# probably a text area - so it doesnt have a max Length
 #sleep element.typingspeed   # typing speed
 #element.log  " adding c.chr " + c  #.chr.to_s
 #c.chr

value
<not_specific>