Hi guru.
i found one problem? (for me)

if we have page with a lot of elements, :index locator work very slow

as sample (code see below) page contains only 1000 checkboxes
on my pc e6550/2.33 (Win7, IE9, Ruby 1.8.7, Watir 1.8.1)
checkboxes[1000].set took about 6 second.

in my experiments time - almost linear, about 0.6 sec 
for checkboxes[100].set

maybe it's not a problem for small pages, but for complex page it's very 
sad.

is it possible 'fix' this ?

in my case i use elements for 'fix' this in my script, but ...


sample
page generator
-----
puts "<html><body>"
1.upto(1000) do |n|
 name="%04d" % n
 str=%Q(<input id="#{name}" type="checkbox" name="#{name}"><label 
for="#{name}">#{name}</label><br>)
 puts str
end
puts "</body></html>"
-----
code sample
-----
require 'watir'  

$ie = Watir::IE.attach(:url,/chk_test/)

t=t1=Time.new
$ie.checkboxes.each do |c|
 c.set
 t0=Time.new
 puts t0-t1
 t1=t0
end
puts Time.new-t
-----

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com

Reply via email to