Showing posts with label select method. Show all posts
Showing posts with label select method. Show all posts

Thursday 2 January 2014

Select methods in selenium Webdriver...

Select Methods
The following are the most common methods used on drop-down elements.

selectByVisibleText() :
deselectByVisibleText():

Selects/deselects the option that displays the text matching the parameter.
Parameter: The exactly displayed text of a particular option

selectByValue()
deselectByValue()

Selects/deselects the option whose “value” attribute matches the specified parameter.
Parameter: value of the “value” attribute remember that not all drop-down options have the same text and “value”, like in the example below.

selectByIndex()
deselectByValue()


Selects/deselects the option at the given index.
Parameter: the index of the option to be selected


isMultiple()

Returns TRUE if the drop-down element allows multiple selections at a time; FALSE if otherwise.
Needs parameters needed

deselectAll ():


Clears all selected entries. This is only valid when the drop-down element supports multiple selections.

No parameters needed