Hi all:
        I have issue relate to wait for control.
Earlier days I have posted [Wtr-general] Problem with loading time on _javascript_ driven html page [link] http://rubyforge.org/pipermail/wtr-general/2006-May/005949.html

Thank you, Bret.

I have tried to implement this wait_until function on my own. My code handles some situation, however the most case I got an error that I don't really understand.
Error message:
NoMethodError: undefined method `all' for nil:NilClass
    C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1029/./watir.rb:984:in `ole_inner_elements'
    C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1029/./watir.rb:1033:in `locate_input_element'
    C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1029/./watir.rb:3448:in `locate'
    C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1029/./watir.rb:2398:in `exists?'

This is happen randomly at all object when the page changes.
After I try to understand the reason, I found the _javascript_ rendering data has following steps.
1. load object
2. load more attributes of this object
3. load more data that this object needs. (eg. select box options)

My code
1.upto timeout do
  result = object(:text_field,:name,/logonId/)
  if result &&  result.respond_to?('exists?') && result.exists?
        return result
  else
    sleep 1
  end
end

The error is happens at result.exists?
I think this is because object(:text_field,:name,/logonId/) is return the result at (1) stage, which is load object.
What this mean is the text_field tag is already been loaded, but not completely.
So when the result.exists, it goes to @o = @container.locate_input_element(@how, @what, self.class::INPUT_TYPES)

From here, I am lost.

Could someone help me with this?
Maybe my finding about _javascript_ loading object is not right.

Please help me! Thanks everyone.

Regards,
Jonathan Ni
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to