当前位置:网站首页>Selenium displays webdriverwait
Selenium displays webdriverwait
2022-04-23 20:43:00 【weixin_ fifty-two million five hundred and thirty-nine thousand】
Routine usage
from selenium.webdriver.common.by import By
from selenium.webdriver.remote.webdriver import WebDriver
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
class HomePage:
exists_link = (By.XPATH, '/html/body/div[2]/div/div[2]/div[1]/span')
def __init__(self, driver: WebDriver):
self.driver = driver
def get_element_exists(self):
try:
WebDriverWait(self.driver, 10).until(EC.visibility_of_element_located(self.exists_link))
except:
return False
else:
return True
2、 Waiting conditions and their meaning
Waiting conditions | meaning |
---|---|
title_is
|
The title is something
|
title_contains
|
The title contains something
|
presence_of_element_located
|
Node load out , Incoming location tuples , Such as
(By.ID, 'p')
|
visibility_of_element_located
|
Nodes are visible , Incoming location tuples
|
visibility_of
|
so , Pass in the node object
|
presence_of_all_elements_located
|
All nodes are loaded out
|
text_to_be_present_in_element
|
A node text contains a text
|
text_to_be_present_in_element_value
|
A node value contains a text
|
frame_to_be_available_and_switch_to_it frame
|
Load and switch
|
invisibility_of_element_located
|
Nodes are not visible
|
element_to_be_clickable
|
Node clickable
|
staleness_of
|
Determine whether a node is still
DOM, Can determine whether the page has been refreshed
|
element_to_be_selected
|
Nodes can be selected , Pass node object
|
element_located_to_be_selected
|
Nodes can be selected , Incoming location tuples
|
element_selection_state_to_be
|
Pass in the node object and status , Equal return
True, Otherwise return to
False
|
element_located_selection_state_to_be
|
Incoming location tuples and status , Equal return
True, Otherwise return to
False
|
alert_is_present
|
Does it appear?
Alert
|
版权声明
本文为[weixin_ fifty-two million five hundred and thirty-nine thousand]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204232042544815.html
边栏推荐
- Devaxpress report replay: complete the drawing of conventional two-dimensional report + histogram + pie chart
- On IRP from the perspective of source code
- Syntax Error: TypeError: this. getOptions is not a function
- LeetCode 709、转换成小写字母
- 6-5 字符串 - 2. 字符串复制(赋值) (10 分)C语言标准函数库中包括 strcpy 函数,用于字符串复制(赋值)。作为练习,我们自己编写一个功能与之相同的函数。
- Leetcode 1346. Check whether integers and their multiples exist
- Identifier CV is not defined in opencv4_ CAP_ PROP_ FPS; CV_ CAP_ PROP_ FRAME_ COUNT; CV_ CAP_ PROP_ POS_ Frames problem
- Go限制深度遍历目录下文件
- bounding box iou
- 內網滲透之DOS命令
猜你喜欢
高薪程序员&面试题精讲系列91之Limit 20000加载很慢怎么解决?如何定位慢SQL?
中创存储|想要一个好用的分布式存储云盘,到底该怎么选
Latest investigation and progress of building intelligence based on sati
Rt-1052 learning notes - GPIO architecture analysis
LeetCode 116. 填充每个节点的下一个右侧节点指针
GO語言開發天天生鮮項目第三天 案例-新聞發布系統二
On IRP from the perspective of source code
浅谈数据库设计之三大范式
Vscode download speed up
DOS command of Intranet penetration
随机推荐
Install MySQL 5.0 under Linux 64bit 6 - the root password cannot be modified
JSX syntax rules
Go language development Daily Fresh Project Day 3 Case - Press Release System II
Go zero framework database avoidance Guide
"Meta function" of tidb 6.0: what is placement rules in SQL?
黑客的入侵方式你知道几种?
MySQL 存储过程和函数
Bash script learning -- for loop traversal
The construction and use of Fortress machine and springboard machine jumpserver are detailed in pictures and texts
内网渗透之DOS命令
Introduction to standardization, regularization and normalization
Leetcode 74. Search two-dimensional matrix
Linux中,MySQL的常用命令
Go limit depth traversal of files in directory
2021-06-29 C escape character cancellation and use
Elastic box model
Bracket matching -- [implementation of one-dimensional array]
CONDA environment management command
Leetcode 1346. Check whether integers and their multiples exist
高薪程序员&面试题精讲系列91之Limit 20000加载很慢怎么解决?如何定位慢SQL?