Doh! Thanks Paul :) On 6/12/07, Paul Rogers <[EMAIL PROTECTED]> wrote:
use this instead @ie.div(:class, 'PopupMenuLabel title').button(:class,'Button Menu').click Hey gang, I am updating a script due to a GUI change. There was previously only one button on the page where class = 'Button Menu'. Now there are two. I'm trying to identify the button by the div it's in, like so: @ie.div(:class, 'PopupMenuLabel title')[EMAIL PROTECTED](:class,'Button Menu').click But I get the following syntax error: add_many_types.rb:34: syntax error, unexpected tIVAR @ie.div(:class, 'PopupMenuLabel title').@ ie.button(:class,'Button Menu').click When I cut that line back to the original @ie.button(:class,'Button Menu').click The script runs...but hits the wrong button. My second choice for resolving this was the somewhat more fragile @ie.button(:class =>'Button Menu', :index => 2).click which yielded c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:1098:in `send': {:class=>"Button Menu", :index=>2} is not a symbol (TypeError) from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:1098:in `locate_input_element' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:1091:in `each' from c:/ruby/lib/ruby/gems/1.8/gems/watir- 1.5.1.1166/./watir.rb:1091:in `locate_input_element' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:3716:in `locate' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:2411:in `assert_exists' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:2642:in `enabled?' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:2417:in `assert_enabled' from c:/ruby/lib/ruby/gems/1.8/gems/watir- 1.5.1.1166/./watir.rb:2587:in `click!' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:2573:in `click' I'm wondering what I am doing wrong in both cases. Thanks! Jeff -- http://testingjeff.wordpress.com _______________________________________________ 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
-- http://testingjeff.wordpress.com
_______________________________________________ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general