a Wild Guess here.
But you seem to click on something which loads the page, yes?
and then you grab a frame first and then you ask how many tables there
are...
Could it be possible that at the time you grab the frame the DOM has not
finished loading?
In 25% of your tests the DOM is complete and it returns the correct count.
Try to run the tests and query the document readyState to see if it has
finished loading before you ask for tables count.
again... this is just a wild guess.

marekj

On 7/20/07, Philip Rhoades <[EMAIL PROTECTED]> wrote:

People,

The following script returns 1 most of the time but about 25% of the time
returns the correct value of 8.  There is one main table and 7 sub tables -
why would the results vary?

Thanks,

Phil.

PS System: Fedora 7 + FF 2.0.0.4


#!/usr/bin/ruby

require 'rubygems'
require 'firewatir'
include FireWatir

ff=Firefox.new
ff.goto( "http://localhost/ledgersmb/login.pl"; )
ff.text_field( :name, "login" ).set( "tst" )
ff.text_field( :name, "password" ).set( "......" )
ff.button( :value, "login" ).click

fr_menu = ff.frame( :name, 'acc_menu' )
fr_menu.link( :index, 1 ).click

fr_main = ff.frame( :name, 'main_window' )

puts fr_main.tables.length
_______________________________________________
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

_______________________________________________
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to