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


Python WebDriverWait.value_of_css_property方法代码示例

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


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

示例1: test_hotkey

# 需要导入模块: from selenium.webdriver.support.ui import WebDriverWait [as 别名]
# 或者: from selenium.webdriver.support.ui.WebDriverWait import value_of_css_property [as 别名]
    def test_hotkey(self):
        driver = self.driver

        shift_n_label = WebDriverWait(self.driver, 10).until(
            expected_conditions.visibility_of_element_located((By.ID, "_Shift_n"))
        )

        ActionChains(driver).key_down(Keys.SHIFT).send_keys("n").key_up(Keys.SHIFT).perform()
        self.assertEqual("rgba(12, 162, 255, 1)", shift_n_label.value_of_css_property("background-color"))
开发者ID:upgundecha,项目名称:learnsewithpython,代码行数:11,代码来源:hotkey_test.py

示例2: _verifyRGB

# 需要导入模块: from selenium.webdriver.support.ui import WebDriverWait [as 别名]
# 或者: from selenium.webdriver.support.ui.WebDriverWait import value_of_css_property [as 别名]
 def _verifyRGB(self, driver, imageName, rgbStr ):
     xPath = "//div[@qxclass='skel.widgets.Image.Stack.TreeItem']/div[text()='" + imageName + "']/../div[@qxclass='skel.widgets.Image.Stack.CustomIcon']"
     item = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, xPath)))
     styleStr = item.get_attribute("style")
     print "Style=",styleStr
     rgb = item.value_of_css_property( 'background-color')
     print "RGB color=",rgb
     print "RGBSTR=", rgbStr
     self.assertTrue( rgb==rgbStr, "Red Icon not correct color")
开发者ID:Astroua,项目名称:CARTAvis,代码行数:11,代码来源:tStack.py

示例3: test_

# 需要导入模块: from selenium.webdriver.support.ui import WebDriverWait [as 别名]
# 或者: from selenium.webdriver.support.ui.WebDriverWait import value_of_css_property [as 别名]
def test_():
    rollbar.init(os.environ.get('rollbar'))

    email = os.environ.get('email')
    password = os.environ.get('password')
    assert email and password

    wait_time = int(os.environ.get('wait', default_wait))

    try:
        options = webdriver.ChromeOptions()
        options.add_argument('--headless')

        driver = webdriver.Chrome(chrome_options=options)

        driver.get(renren)

        input_email = WebDriverWait(driver, wait_time).until(
            EC.presence_of_element_located((By.ID, 'email'))
        )
        input_password = WebDriverWait(driver, wait_time).until(
            EC.presence_of_element_located((By.ID, 'password'))
        )
        btn_login = WebDriverWait(driver, wait_time).until(
            EC.presence_of_element_located((By.ID, 'login'))
        )

        input_email.clear()
        input_password.clear()
        input_email.send_keys(email)
        input_password.send_keys(password)
        driver.execute_script('arguments[0].click()', btn_login)

        btn_fortune = WebDriverWait(driver, wait_time).until(
            EC.presence_of_element_located((By.ID, 'assembleBtn'))
        )

        driver.execute_script('arguments[0].click()', btn_fortune)

        popup = WebDriverWait(driver, wait_time).until(
            EC.visibility_of_element_located((By.ID, 'forPopupBox'))
        )

        passed = popup.value_of_css_property('display') == 'block'
        if not passed:
            rollbar.report_message('Test Failed')
        assert passed
    except WebDriverException:
        rollbar.report_message('Test Errored')
        assert False
    else:
        rollbar.report_message('Test Passed')
        assert True
    finally:
        driver.quit()
开发者ID:xhh09a,项目名称:rrfortune,代码行数:57,代码来源:test_rrfortune.py

示例4: test_hotkey

# 需要导入模块: from selenium.webdriver.support.ui import WebDriverWait [as 别名]
# 或者: from selenium.webdriver.support.ui.WebDriverWait import value_of_css_property [as 别名]
    def test_hotkey(self):
        driver = self.driver

        shift_n_label = WebDriverWait(self.driver, 10).\
            until(expected_conditions.visibility_of_element_located((By.ID, '_Shift_n')))

        ActionChains(driver).\
            key_down(Keys.SHIFT).\
            send_keys('n').\
            key_up(Keys.SHIFT).perform()
        self.assertEqual('rgba(255, 255, 255, 1)',
                         shift_n_label.value_of_css_property('background-color'))
开发者ID:bryzhevska,项目名称:settests,代码行数:14,代码来源:hotkey_test.py

示例5: test_hotkey

# 需要导入模块: from selenium.webdriver.support.ui import WebDriverWait [as 别名]
# 或者: from selenium.webdriver.support.ui.WebDriverWait import value_of_css_property [as 别名]
    def test_hotkey(self):
        driver = self.driver

        shift_n_label = WebDriverWait(self.driver, 10).until(
            expected_conditions.visibility_of_element_located(
                (By.ID, "_Shift_n")
            )
        )

        # needs driver instance then can arrage sequence of events by
        # calling the availaable methods and executing the action with
        # the perform method
        ActionChains(driver).key_down(
            Keys.SHIFT
        ).send_keys(
            'n'
        ).key_up(
            Keys.SHIFT
        ).perform()
        self.assertEqual(
            "rgba(255, 255, 255, 1)",
            #"rgba(12, 162, 255, 1)",
            shift_n_label.value_of_css_property("background-color")
        )
开发者ID:CheoR,项目名称:STTWP,代码行数:26,代码来源:hotkey_test.py


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