I put the script in a loop to run 20 times - typically, there'll be 2 errors out of twenty. Could someone else try this:
for %i in (1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20) do ruby concurrent_search.rb I put in a "sleep 1" between the ie.start and the ie.test_field and still got failures. A few other things that didn't work (I'm just fishing): - putting ie.wait after the the ie.start - replace ie.start with ie = IE.new; ie.goto Changing the number of threads to 1 did work -->> no errors Changing the number of threads to 2 did NOT work I'm using the current stable version of ruby (1.8.2-14, I believe) and the watir 1.4. I'm running win2k (service pack 4) on an old 730 MHz Gateway with 256 Mb memory On Thu, 04 Aug 2005 17:08:36 -0500 Bret Pettichord <[EMAIL PROTECTED]> wrote: > My guess is that this is a timing issue of some sort and ultimately a > bug (race condition) in watir. > > One thing you can do is put small sleep statements in there. > > For example put a "sleep 0.1" right before the failing line and then > see if you can reproduce the problem. If not, that proves it is a > race condition. (We still would need to figure out exactly where the > problem is, however.) > > Bret > > At 01:42 PM 8/4/2005, Warren Pollans wrote: > >OK, I was wrong, the behavior is intermittent. Sometimes it works and > >sometimes it doesn't :-( Any suggestions about how to track this > >down? > > > >On Thu, 4 Aug 2005 14:35:36 -0400 > >Warren Pollans <[EMAIL PROTECTED]> wrote: > > > > > Hmmm, I get the error if there's no browser window open at the > > > start. If a browser window is already open, it runs without > > > error. Is this the expected behavior? > > > > > > > > > > > > On Thu, 04 Aug 2005 12:03:00 -0600 > > > Paul Rogers <[EMAIL PROTECTED]> wrote: > > > > > > > Well, it works for me ;-) > > > > > > > > The error is that watir couldn't find the text field where you > > > > enter the search term. > > > > I live in canada, and I always get redirected to google.ca, so > > > > maybe something similar is happening for you and the search box > > > > has a different name... > > > > Other than that I cant really help... > > > > > > > > -----Original Message----- > > > > From: [EMAIL PROTECTED] > > > > [mailto:[EMAIL PROTECTED] On Behalf Of Warren > > > > Pollans Sent: 04 August 2005 11:39 > > > > To: [email protected] > > > > Subject: [Wtr-general] example/concurrent_search error > > > > > > > > > > > > Hello, > > > > > > > > Sorry, if this is obvious - I'm new to ruby, watir, and windows > > > > - I'm coming from perl on unix. > > > > > > > > What have I missed here? I ran the example concurrent_search > > > > test and got the following: > > > > > > > > > > > > C:\watir_bonus\examples>ruby concurrent_search.rb > > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1939:in `assert_exists': > > > > Unable to locate object, using name and q > > > > (Watir::Exception::UnknownObjectException) from > > > > concurrent_search.rb:18:in `join' from concurrent_search.rb:18 > > > > from concurrent_search.rb:18:in `each' > > > > from concurrent_search.rb:18 > > > > > > > > > > > > C:\watir_bonus\examples>more concurrent_search.rb > > > > # demonstrate ability to run multiple tests concurrently > > > > > > > > require 'thread' > > > > require 'watir' > > > > > > > > def test_google > > > > ie = Watir::IE.start('http://www.google.com') > > > > ie.text_field(:name, "q").set("pickaxe") > > > > ie.button(:value, "Google Search").click > > > > ie.close > > > > end > > > > > > > > # run the same test three times concurrently in separate > > > > browsers threads = [] 3.times do > > > > threads << Thread.new {test_google} > > > > end > > > > threads.each {|x| x.join} > > > > _______________________________________________ > > > > Wtr-general mailing list > > > > [email protected] > > > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > > > > _______________________________________________ > > > > Wtr-general mailing list > > > > [email protected] > > > > http://rubyforge.org/mailman/listinfo/wtr-general > > > _______________________________________________ > > > Wtr-general mailing list > > > [email protected] > > > http://rubyforge.org/mailman/listinfo/wtr-general > >_______________________________________________ > >Wtr-general mailing list > >[email protected] > >http://rubyforge.org/mailman/listinfo/wtr-general > > _____________________ > Bret Pettichord > www.pettichord.com > > _______________________________________________ > Wtr-general mailing list > [email protected] > http://rubyforge.org/mailman/listinfo/wtr-general _______________________________________________ Wtr-general mailing list [email protected] http://rubyforge.org/mailman/listinfo/wtr-general
