zoukankan      html  css  js  c++  java
  • 【python】显示等待

    import unittest
    from common.common1 import common2
    from selenium.webdriver.support import expected_conditions as EC
    from selenium.webdriver.support.ui import WebDriverWait
    from selenium.webdriver.common.by import By

    class Test13(unittest.TestCase):
    def setUp(self) -> None:
    self.driver=common2().login()

    def test13(self):
    self._testMethodName="test13"
    self._testMethodDoc="新建应用(跳转url)!"
    #显示等待+点击首页上的新建应用
    WebDriverWait(self.driver, 10, 1).until(EC.visibility_of_element_located((By.XPATH,"//span[text()='新建应用']"))).click()
    #显式等待+断言
    actual_result =WebDriverWait(self.driver, 10, 1).until(EC.visibility_of_element_located((By.XPATH,"//h2[text()='新建应用']")))
    self.assertEqual(actual_result.text,'新建应用')

    if __name__=='main__':
    unittest.main()


  • 相关阅读:
    PTA 7-6 列出连通集(深搜+广搜)
    TZOJ 2648 小希的迷宫(并查集)
    HDU 3342 Legal or Not(拓扑排序)
    哈夫曼树
    mst
    [THUWC2017]随机二分图
    视察
    [bzoj3274]Circle
    [bzoj3273]liars
    求导相关
  • 原文地址:https://www.cnblogs.com/luoguoxing/p/15134226.html
Copyright © 2011-2022 走看看