id Attribute
Watir code to set a select box item using the id attribute:ie.select_list(:id, "one").set("is fun")
name Attribute
Watir code to set a select box item using the name attribute:ie.select_list(:name, "selectme").set("is fun")
Selection Box Methods
Watir code to clear a select box item using the id attribute:ie.select_list(:id, "one").clearSelection
contents = ie.select_list(:id, "one").getAllContents
Select Multiple
Some select lists can have multiple selections instead of just one. If multiple items can be selected in select box, Watir can set or clear an item.What you see in the web browser:
ie.select_list(:id, 'one').set('Web Testing') ie.select_list(:id, 'one').set('in Ruby') ie.select_list(:id, 'one').set('is fun') ie.select_list(:id, 'one').clearSelection
guud one brother!!!!!!!!
ReplyDelete