Selenium2library Series Keywords _selectelementkeywords select_all_from_list (self, locator)

Source: Internet
Author: User

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.