unknownbits
unknownbits

Reputation: 2885

how to check drop down is selected or not using watir?

I want to check whether dropdown is selected or not

if(ie.select_list(:id, "DropDownList").selected?)#this is wrong
  puts "selected"
else
   puts "not selected"
end

how can I check this?

Upvotes: 1

Views: 836

Answers (1)

Arup Rakshit
Arup Rakshit

Reputation: 118271

Look here find out the value in select list

ar_vals = ie.select_list(:id, "DropDownList").selected_options
ar_vals.empty? ? puts "not selected" : puts "selected"

Upvotes: 2

Related Questions