def set_select_by_value(self, select, value):
'''
Set the selected value of a select element by the value.
Parameters
----------
select: str or selenium.webdriver.remote.webelement.WebElement
Any valid CSS selector or a selenium element
value: str
The value on the select element option. (Not the visible text)
'''
if isinstance(select, str):
elem = self.get_element(select)
else:
elem = select
sel = Select(elem)
sel.select_by_value(value)
评论列表
文章目录