【python】显示等待
2021/8/12 20:06:10
本文主要是介绍【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()
这篇关于【python】显示等待的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-05-08有遇到过吗?同样的规则 Excel 中 比Python 结果大
- 2024-03-30开始python成长之路
- 2024-03-29python optparse
- 2024-03-29python map 函数
- 2024-03-20invalid format specifier python
- 2024-03-18pool.map python
- 2024-03-18threads in python
- 2024-03-14python Ai 应用开发基础训练,字符串,字典,文件
- 2024-03-13id3 algorithm python
- 2024-03-13sum array elements python