Thanks for replies. About method "ready", yea it write in stupid way and on IF !ready($b) is used (method name should be named notReady).. Updating ruby with watir doesn't solve my problem. However I found other solution:
I change: $b.text_field(:id, 'singlelineedit1').when_present.set("1") to: $b.text_field(:id, 'singlelineedit1').when_present.value = "1" and no more ugly error :) On Nov 21, 9:29 pm, brett sykes <brettcsy...@gmail.com> wrote: > Yes, it looks like his ready method is returning true when the browser is > in a busy state. But, besides that point, if you take Chucks advice and > update to a more modern version (like 1.9.1), you can take advantage of the > very cool #when_present extension and simplify your current code to > something more along the lines of: > #------------- > 999.times do > $b.text_field(:id, 'singlelineedit1').when_present.set("1") > $b.text_field(:id, 'multilineedit1').when_present.set("...") > $b.button(:id, "button1").when_present.click > end > #------------- > Brett > > On Mon, Nov 21, 2011 at 2:07 PM, Chuck van der Linden <sqa...@gmail.com>wrote: > > > > > > > > > maybe I'm not reading things right, but I think your 'ready' method is > > returning true when the browser is not ready > > > I might also recommend a more current version of Watir, v1.6.7 is a > > little old You might want to try this with 1.9.1 and see if it works > > any differently for you. > > > On Nov 21, 9:00 am, xeranas <anorku...@gmail.com> wrote: > > > Hi all, > > > I trying to do simple task fill 2 fields and click 'add', and so on.. > > > ~ 80 times. But currently it crashes after 20-30 times with errors > > > below. > > > > I guess this must be 'synchronous' problem.. But I have no idea how I > > > can fix it. I use methods: > > > check page with ie.busy and ie.readyState, before every action, do > > > check if field exist before making action with it.. nothing is useful > > > except sleep, but it's very slow down script. > > > > Please note that ~20 times watir handle situation correctly, but later > > > somehow can't find method which was used ~20 times before in loop.. > > > > If you interested for my code:http://pastebin.com/xEKHp129 > > > > C:/Ruby187/lib/ruby/gems/1.8/gems/watir-1.6.7/lib/watir/ > > > input_elements.rb:415:in > > > `method_missing': fireEvent (WIN32OLERuntimeError) > > > OLE error code:80004005 in htmlfile > > > Unspecified error. > > > HRESULT error code:0x80020009 > > > Exception occurred. > > > from C:/Ruby187/lib/ruby/gems/1.8/gems/watir-1.6.7/lib/watir/ > > > input_eleme > > > nts.rb:415:in `type_by_character' > > > from C:/Ruby187/lib/ruby/gems/1.8/gems/watir-1.6.7/lib/watir/ > > > input_eleme > > > nts.rb:427:in `characters_in' > > > from C:/Ruby187/lib/ruby/gems/1.8/gems/watir-1.6.7/lib/watir/ > > > input_eleme > > > nts.rb:412:in `type_by_character' > > > from C:/Ruby187/lib/ruby/gems/1.8/gems/watir-1.6.7/lib/watir/ > > > input_eleme > > > nts.rb:378:in `set' > > > from coll_items1000.rb:52 > > > from coll_items1000.rb:42:in `times' > > > from coll_items1000.rb:42 > > > -- > > Before posting, please readhttp://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<http://groups.google.com/group/watir-general%0Awatir-general+unsubscr...> -- 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