当前位置: 首页>>代码示例>>Python>>正文


Python Select.send_keys方法代码示例

本文整理汇总了Python中selenium.webdriver.support.ui.Select.send_keys方法的典型用法代码示例。如果您正苦于以下问题:Python Select.send_keys方法的具体用法?Python Select.send_keys怎么用?Python Select.send_keys使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在selenium.webdriver.support.ui.Select的用法示例。


在下文中一共展示了Select.send_keys方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: filter

# 需要导入模块: from selenium.webdriver.support.ui import Select [as 别名]
# 或者: from selenium.webdriver.support.ui.Select import send_keys [as 别名]
    def filter(self, name, value):
        """filters the table by using value for the column specified by name.

        Note that this abstracts the different ways filter controls can be implemented.
        """
        filter_ = self.e.find_element_by_id('dt-filter-%s' % name)
        if filter_.find_elements_by_tag_name('option'):
            filter_ = Select(filter_)
            filter_.select_by_visible_text(value)
        else:
            filter_.send_keys(value)
        time.sleep(2.5)
开发者ID:FieldDB,项目名称:clld,代码行数:14,代码来源:util.py

示例2: impl

# 需要导入模块: from selenium.webdriver.support.ui import Select [as 别名]
# 或者: from selenium.webdriver.support.ui.Select import send_keys [as 别名]
def impl(context):
    dropdown = Select(find_id_with_wait(context, "group-select"))
    dropdown.select_by_visible_text("0")
    # For some reason this only triggers properly if you defocus or press enter after the select
    dropdown = find_id_with_wait(context, "group-select")
    dropdown.send_keys(Keys.RETURN)
开发者ID:Aypak,项目名称:ka-lite,代码行数:8,代码来源:coachreports.py

示例3: Select

# 需要导入模块: from selenium.webdriver.support.ui import Select [as 别名]
# 或者: from selenium.webdriver.support.ui.Select import send_keys [as 别名]
for (key,value) in shipping_info_next:
	ele_selector = key
	ele = Select(driver.find_element(By.ID,ele_selector))
	ele.select_by_visible_text(value)

#
shipping_info_next = {
	'address_zip' : '80302',
}

time.sleep(SLEEP_SECS)
for key,value in shipping_info_next.iteritems():
	ele_selector = key
	ele = driver.find_element_by_id(ele_selector)
	ele.send_keys(value)

#
shipping_info_next = {
	'speed' : 'speed-std',
}

time.sleep(SLEEP_SECS)
for key,value in shipping_info_next.iteritems():
	ele_selector = key
	ele = driver.find_element_by_id(value)
	ele.click()

#click add to cart
time.sleep(SLEEP_SECS)
ele_number = 0
开发者ID:owocki,项目名称:selenium-experiments,代码行数:32,代码来源:test_that_stores_working.py


注:本文中的selenium.webdriver.support.ui.Select.send_keys方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。