Closed GoogleCodeExporter closed 9 years ago
You can directly try filling the textbox using textbox.value = "some value".
Only
reason why textbox.set("value") is used because there are certain web
applications
that do fire these events. If in your case these events are not fired/used you
can
directly set the value from your script. This will save time.
Original comment by ang...@gmail.com
on 23 Oct 2007 at 6:05
Original comment by ang...@gmail.com
on 8 Apr 2008 at 7:46
solve slow key type issue on firewatire:
====================================================
need to edit the file "text_field.rb"
enter to the folder
1)#>cd /usr/lib/ruby/gems/1.8/gems/firewatir-1.7.1/lib/firewatir/elements/
make it writeable
2)#>chmod 777 text_field.rb
edite the proc "def doKeyPress( value )"
3) put # in front of @o.fireEvent("onKeyDown") and @o.fireEvent("onKeyPress")
and @o.fireEvent("onKeyPress")
insted enter "fire_key_events"
-----------------------------------
def doKeyPress( value )
begin
max = maxlength
if (max > 0 && value.length > max)
original_value = value
value = original_value[0...max]
element.log " Supplied string is #{suppliedValue.length} chars, which exceeds the max length (#{max}) of the field. Using value: #{value}"
end
rescue
# probably a text area - so it doesnt have a max Length
end
for i in 0..value.length-1
#sleep element.typingspeed # typing speed
c = value[i,1]
#element.log " adding c.chr " + c #.chr.to_s
@o.value = "#{(@o.value.to_s + c)}" #c.chr
fire_key_events #add this
#@o.fireEvent("onKeyDown")
#@o.fireEvent("onKeyPress")
#@o.fireEvent("onKeyUp")
end
----------------------------------------------
now it should work faster
Original comment by shayefr...@gmail.com
on 16 Feb 2011 at 12:09
Original issue reported on code.google.com by
ghimus
on 22 Oct 2007 at 10:02