korimo / firewatir

Automatically exported from code.google.com/p/firewatir
0 stars 0 forks source link

How to speed up text field data entry #78

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create identical scripts for Watir/Firewatir that use data entry into
text fields
2. Execute scripts

What is the expected output? What do you see instead?
I'd like to see the same speed/performance that Watir provides.

What version of the product are you using? On what operating system?
firewatir-1.2.0, Windows XP

Please provide any additional information below.

I'm using both Watir and FireWatir.  I've developed a script that
works well with both APIs.  However, it seems that when the script is
executed in FireWatir, the speed with which data is entered into text
fields is *really* slow.  Anybody out there know how I can speed up
data entry into text fields for FireWatir. I've tried using

text_field.value='my value'

instead of

text_field.set 'my value'

However, it appears that using .value= results in the script missing
some of the web app's triggering events.  Any help on this would be
greatly appreciated.

Regards,
Robert 

Original issue reported on code.google.com by restag...@gmail.com on 11 Aug 2008 at 5:17

GoogleCodeExporter commented 9 years ago
I have noticed VERY slow text entry on a windows Server 2003 box with firefox
2.0.0.16 and firewatir 1.2.1 (it also ran slow with 1.1.1) and 
jssh-WINNT-2.x.xpi. 
The code runs from a ruby-rails application. The same code works fast on os/x 
with
the same firefox/firewatir versions.  I have a linux install as well, with a 
self
built version of firefox 3.0 with jssh following the instructions here:
(http://ubuntu-snippets.blogspot.com/2008/07/build-firefox-3-web-browser-with-js
sh.html).
This setup also runs very slowly at times for text entry with firewatir 1.2.0.

The behavior isn't consistent, sometimes it runs at normal speed, sometimes in 
super
slow-mo.

Any help or clues would be appreciated as to why firewatir-jssh/firefox may run 
super
slow.

Original comment by robblov...@gmail.com on 25 Aug 2008 at 9:36

GoogleCodeExporter commented 9 years ago
here is another person who experienced a slow down:
http://www.io.com/~wazmo/blog/archives/2007_11.html

Original comment by robblov...@gmail.com on 25 Aug 2008 at 10:22

GoogleCodeExporter commented 9 years ago
I use ruby 1.8.7 on Windows with Firefox 3.0.10 and the current version of 
Firewatir
as on May 12,2009.  Same issue with text_field.set "xyz".  It is too slow.

Original comment by talksens...@gmail.com on 12 May 2009 at 11:16

GoogleCodeExporter commented 9 years ago
Really slow. My SafariWatir (Mac OS X 10.6 + Safari) needs 50 seconds to run a 
bunch of tests, which FireWatir (at 
Ubuntu 9.04 + Firefox 3) needs 5 minutes.

Original comment by juliomon...@gmail.com on 17 Sep 2009 at 5:12

GoogleCodeExporter commented 9 years ago
moved to http://jira.openqa.org/browse/WTR-397

Original comment by zeljko.f...@gmail.com on 5 Nov 2009 at 12:07

GoogleCodeExporter commented 9 years ago
Ticket moved to http://jira.openqa.org/browse/WTR. Please see comments for
the exact URL.

Original comment by zeljko.f...@gmail.com on 20 Nov 2009 at 10:39

GoogleCodeExporter commented 9 years ago

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:04