Reputation: 87
require 'watir'
ie = Watir::Browser.new
ie.goto "http://www.wallpapers.com/windows/Wallpapers/Animals/Dogs"
ie.select(:id, "ctl00_CPH1_ctl00_ddlSortExpression").flash
ie.select(:id, "ctl00_CPH1_ctl00_ddlSortExpression").set("Newest")
C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.0.0/lib/watir-classic/element.rb:433:in `method_missing': undefined method `set' for #<Watir::SelectList:0x31be0b8> (NoMethodError)
from sample.rb:9:in `<main>'
also tried with same result:
ie.select(:id, "ctl00_CPH1_ctl00_ddlSortExpression").to_subtype.set("Newest")
Upvotes: 3
Views: 1394
Reputation: 46846
Use .select()
instead:
ie.select(:id, "ctl00_CPH1_ctl00_ddlSortExpression").select("Newest")
In Watir 3.0, .set()
no longer exists for select lists. Not sure if it is a bug or removed on purpose.
Upvotes: 5