Vapir Slow...

13 views
Skip to first unread message

Grzegorz Smajdor

unread,
Aug 17, 2010, 8:34:18 AM8/17/10
to Vapir
Hi,

I am testing Vapir on mac 10.6.4 its quite promissing as I need utf-8
support ant it seems to work.
But Vapir works really slow. Is there a possibility to speed it up?
Cause filling in the text field takes ages.

Will appreciate any help.

Br,
Grzegorz

Ethan

unread,
Aug 17, 2010, 11:24:19 AM8/17/10
to va...@googlegroups.com
It is very slow, especially entering text fields. I know, and this is a high priority for me to fix. 
You can turn off typing keys, if you do not need that simulated, and that should speed up that aspect significantly. The interface to set that option doesn't exist in the firefox version of vapir, but you can make it happen using:

class Vapir::Firefox::Element
  def type_keys
    false
  end
end

That's an ugly way to do it, but it'll work. 
The rest of vapir-firefox is still slow (except on windows with ruby 1.8, for whatever reason - I'm not entirely sure why), and improving that is a high priority. 

Grzegorz Smajdor

unread,
Aug 18, 2010, 5:00:04 AM8/18/10
to Vapir
Hey,

Yeap, thanks for the answer.

This helped a bit.

I remember the same problem with FireWatir some time ago, but now its
really improved.

Br,
Grzegoz

On Aug 17, 5:24 pm, Ethan <notet...@gmail.com> wrote:
> It is very slow, especially entering text fields. I know, and this is a high
> priority for me to fix.
> You can turn off typing keys, if you do not need that simulated, and that
> should speed up that aspect significantly. The interface to set that option
> doesn't exist in the firefox version of vapir, but you can make it happen
> using:
>
> class Vapir::Firefox::Element
>   def type_keys
>     false
>   end
> end
>
> That's an ugly way to do it, but it'll work.
> The rest of vapir-firefox is still slow (except on windows with ruby 1.8,
> for whatever reason - I'm not entirely sure why), and improving that is a
> high priority.
>
> On Tue, Aug 17, 2010 at 08:34, Grzegorz Smajdor
> <grzegorz.smaj...@gmail.com>wrote:

xul...@yahoo.com

unread,
Aug 25, 2010, 5:44:24 PM8/25/10
to Vapir
Dear Ethan,

to disable type_keys (set as false) makes set the text field faster,
but lost the feature of "simulating" key enter. I have one page need
fillup the form and after I added the type_keys to false, it will
disappear shortly.
Any ideas how to keep the key enter faster and not lost the
simulating.
thanks in advance.

xulivan

On Aug 18, 2:00 am, Grzegorz Smajdor <grzegorz.smaj...@gmail.com>
wrote:

Ethan

unread,
Aug 25, 2010, 6:09:22 PM8/25/10
to va...@googlegroups.com
Unfortunately, not at the moment. Simulating keypresses is slow, and it's all-or-nothing. 

There is a fix that I will include in the next release which makes it simulate at least one keypress around value-setting, which should satisfy most javascript stuff (think of it like pressing ctrl+v to paste the text in, instead of actually typing the full thing). 

I will also work on improving the performance of key-typing with full keypress simulation, for a future version, though hopefully other performance improvements I have planned will preempt that and make it unnecessary. 

xul...@yahoo.com

unread,
Aug 25, 2010, 7:24:06 PM8/25/10
to Vapir
Is it possible to enable/disable the key simulating when needed in
element.rb level to make it more efficient?

You meant the next release which will be 1.7.2, right? I noticed that
the 1.7.1 already released.
Again, thanks,


On Aug 25, 3:09 pm, Ethan <notet...@gmail.com> wrote:
> Unfortunately, not at the moment. Simulating keypresses is slow, and it's
> all-or-nothing.
>
> There is a fix that I will include in the next release which makes it
> simulate at least one keypress around value-setting, which should satisfy
> most javascript stuff (think of it like pressing ctrl+v to paste the text
> in, instead of actually typing the full thing).
>
> I will also work on improving the performance of key-typing with full
> keypress simulation, for a future version, though hopefully other
> performance improvements I have planned will preempt that and make it
> unnecessary.
>

Željko Filipin

unread,
Aug 26, 2010, 4:25:56 AM8/26/10
to va...@googlegroups.com
On Thu, Aug 26, 2010 at 12:09 AM, Ethan <note...@gmail.com> wrote:
> Simulating keypresses is slow, and it's all-or-nothing.

I thought there was a feature in Watir (not sure if it is in your fork) that allows you to simulate keypress for just one text field. I will try to find a reference and post a link here.

Željko

Željko Filipin

unread,
Aug 26, 2010, 6:45:16 AM8/26/10
to va...@googlegroups.com
On Thu, Aug 26, 2010 at 10:25 AM, Željko Filipin <zeljko....@wa-research.ch> wrote:
> I thought there was a feature in Watir (not sure if it is in your fork) that allows you to simulate keypress for just one text field.

Here it is:

browser.text_field(:how, what).requires_typing.set

Could not find requires_typing in rdoc, but found it in source (line 393):

http://github.com/bret/watir/blob/master/watir/lib/watir/input_elements.rb

Željko

Ethan

unread,
Aug 26, 2010, 10:56:02 AM8/26/10
to va...@googlegroups.com
I don't believe that feature has ever been in firewatir, though, and is not in my fork of firewatir either. 

Željko Filipin

unread,
Aug 26, 2010, 10:57:50 AM8/26/10
to va...@googlegroups.com
On Thu, Aug 26, 2010 at 4:56 PM, Ethan <note...@gmail.com> wrote:
> I don't believe that feature has ever been in firewatir

Could be, I did not check.

Željko

Ethan

unread,
Aug 26, 2010, 12:08:34 PM8/26/10
to va...@googlegroups.com
you could change the previous code hack to be:

class Vapir::Firefox::Element
  attr_accessor :type_keys
end

and set element.type_keys = true when needed. 
If you automatically setting it when needed, rather than manually, that is a lot more coding, I think, and improving performance would be a higher priority for me, and make that unnecessary. 
Reply all
Reply to author
Forward
0 new messages