1 defselect_all_from_list (self, locator):2 """selects all values from multi-select list identified by ' id '.3 4 Key attributes for lists is ' id ' and ' name '. See ' Introduction ' for5 details about locating elements.6 """7Self._info ("Selecting all options from list '%s '."%Locator)8 9select =self._get_select_list (Locator)Ten if notselect.is_multiple: One RaiseRuntimeError ("Keyword ' Select all from list ' works only for multiselect lists.") A - forIinchRange (len (select.options)): -Select.select_by_index (i)
Method Name: Select_all_from_list (self, locator)
Public methods Select all options for the multi-select list
Receive parameters: Locator
9 rows: Use the _get_select_list (self, locator) method to return the Select Object
13, 14 lines: Traverse all options and select
Use:
Output Result:
from ' Id=creouttime '.
Selenium2library Series Keywords _selectelementkeywords select_all_from_list (self, locator)