I have a piece of code as follows.
Here after the Save button is clicked   a pop-up appears with an OK
button.
The pop-up needs to be clicked(on the OK button) or closed for the
script to run further.
This piece of code is run in iterations.It runs fine for a few
iterations(say 2 or 3) and then gives a NilClass error at line
indicated by ******


     ###########The Code##################
     g.save.click_no_wait  #Click on the Save button
      Watir.autoit.WinWait('Windows Internet Explorer') #Wait for the
pop-up
      windw_exist = Watir.autoit.WinExists('Windows Internet
Explorer')#Check if the pop-up exists
      puts "Window Exist = #{windw_exist}"
      windw_active = Watir.autoit.WinActive('Windows Internet
Explorer')#Check if the pop-up is active
      puts "Window Active = #{windw_active}"
      Watir.autoit.WinClose('Windows Internet Explorer')#Close the pop-
up
      #g.jsClick('Windows Internet Explorer', 'OK')
      Watir::Waiter.wait_until(5) { g.edit.exists?}    ******   #Wait
for the Edit button to appear.
      g.edit.click  #Click on the Edit button
      #############The End##################


The actual error seen is as follows
********************************************************************************************
 c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/container.rb:
679:in `ole_i
nner_elements'c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/
container.rb:
741:in `locate_input_element'c:/ruby/lib/ruby/gems/1.8/gems/
watir-1.6.2/lib/wati
r/input_elements.rb:5:in `locate'c:/ruby/lib/ruby/gems/1.8/gems/
watir-1.6.2/lib/
watir/element.rb:273:in `exists?'C:/Lmg_test/ruby/03.06.2010/driver/
cfg_messag2.
rb:102c:/ruby/lib/ruby/gems/1.8/gems/commonwatir-1.6.2/lib/watir/
waiter.rb:80:in
 `wait_until'c:/ruby/lib/ruby/gems/1.8/gems/commonwatir-1.6.2/lib/
watir/waiter.r
b:57:in `wait_until'c:/ruby/lib/ruby/gems/1.8/gems/commonwatir-1.6.2/
lib/watir/w
aiter.rb:80:in `wait_until'C:/Lmg_test/ruby/03.06.2010/driver/
cfg_messag2.rb:102


 undefined method `all' for nil:NilClass

*********************************************************************************************
My queries
1)What value is being returned Nil.
2)How to check the parameter that is returning the nil value.
3)Is it the Edit button.exists that is being shown nil?
4)Should the wait_until time be increased?

Kindly let me know the answers to the above queries.
Please let me know if you need more information on this.

Thanks in Advance

Regards
Chandrika

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

You received this message because you are subscribed to 
http://groups.google.com/group/watir-general
To post: watir-general@googlegroups.com
To unsubscribe: watir-general+unsubscr...@googlegroups.com

Reply via email to