当前位置:网站首页>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
边栏推荐
- 上海回應“面粉官網是非法網站”:疏於運維被“黑”,警方已立案
- MySQL基础之写表(创建表)
- 堡垒机、跳板机JumpServer的搭建,以及使用,图文详细
- How to configure SSH public key in code cloud
- Leetcode 20. Valid parentheses
- LeetCode 20、有效的括号
- 6-5 字符串 - 2. 字符串复制(赋值) (10 分)C语言标准函数库中包括 strcpy 函数,用于字符串复制(赋值)。作为练习,我们自己编写一个功能与之相同的函数。
- Awk print special characters
- Leetcode 232, queue with stack
- Flex layout
猜你喜欢

上海回應“面粉官網是非法網站”:疏於運維被“黑”,警方已立案

GO語言開發天天生鮮項目第三天 案例-新聞發布系統二

MySQL基础之写表(创建表)

Unity animation creates sequence frame code and generates animationclip

Matlab matrix index problem

Leetcode 542, 01 matrix

Come in and teach you how to solve the problem of port occupation

Vscode download speed up

MySQL进阶之表的增删改查

The ODB model calculates the data and outputs it to excel
随机推荐
The problem of 1 pixel border on the mobile terminal
深入探究ASP.NET Core读取Request.Body的正确方式
MySQL stored procedures and functions
三十.什么是vm和vc?
UnhandledPromiseRejectionwarning:CastError: Cast to ObjectId failed for value
On IRP from the perspective of source code
Elastic box model
Create vs project with MATLAB
Use of node template engine
中创存储|想要一个好用的分布式存储云盘,到底该怎么选
Bracket matching -- [implementation of one-dimensional array]
LeetCode 232、用栈实现队列
How many hacking methods do you know?
SQL: query duplicate data and delete duplicate data
Communication between RING3 and ring0
BMP JPEG picture to vector image contourtrace
On BIM data redundancy theory
Vulnhub DC: 1 penetration notes
Latest investigation and progress of building intelligence based on sati
Mathematical modeling column | Part 5: MATLAB optimization model solving method (Part I): Standard Model