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


Python WebDriverWait.is_selected方法代码示例

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


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

示例1: is_checked

# 需要导入模块: from selenium.webdriver.support.wait import WebDriverWait [as 别名]
# 或者: from selenium.webdriver.support.wait.WebDriverWait import is_selected [as 别名]
 def is_checked(self, compared_to_average):
     checkbox = WebDriverWait(self.driver, 30, 0.5).until(
         lambda d: d.find_elements_by_css_selector(self.COMPARED_TO_AVERAGE)[compared_to_average]
     )
     if checkbox.is_selected():
         return True
     return False
开发者ID:Janyell,项目名称:tech-testing-ha2,代码行数:9,代码来源:component.py

示例2: is_business_node_checked

# 需要导入模块: from selenium.webdriver.support.wait import WebDriverWait [as 别名]
# 或者: from selenium.webdriver.support.wait.WebDriverWait import is_selected [as 别名]
 def is_business_node_checked(self, business_node_number):
     checkbox = WebDriverWait(self.driver, 30, 0.5).until(
         lambda d: d.find_elements_by_css_selector(self.BUSINESS_NODES_CHECKBOXES)[business_node_number + 1]
     )
     if checkbox.is_selected():
         return True
     return False
开发者ID:Janyell,项目名称:tech-testing-ha2,代码行数:9,代码来源:component.py

示例3: assertChecked

# 需要导入模块: from selenium.webdriver.support.wait import WebDriverWait [as 别名]
# 或者: from selenium.webdriver.support.wait.WebDriverWait import is_selected [as 别名]
    def assertChecked(self, locator, rule, timeout=-1, msg=None):
        """assert a checkbox, radiobutton or option is checked

        :param locator: the engine to process the rule
        :type locator: selenium.webdriver.common.by.By
        :param rule: the rule the element must match
        :type rule: str
        :param timeout: Number of second that we will poll the DOM. Once this is over, a TimeoutException is raised \
        if timeout is less than 0, no wait is processed
        :type timeout: int
        """
        try:
            if timeout > 0:
                element = WebDriverWait(self.driver, timeout).until(
                        EC.presence_of_element_located((locator, rule))
                )
            else:
                element = self.driver.find_element(locator, rule)
        except (NoSuchElementException, TimeoutException) as e:
            raise self.failureException(str(e))
        self.assertTrue(element.is_selected(), msg=msg)
开发者ID:dcolam,项目名称:test-automation-framework,代码行数:23,代码来源:UITestCase.py


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