当前位置:网站首页>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
边栏推荐
- An error occurs when the addressable assets system project is packaged. Runtimedata is null
- Use of node template engine
- Rt-1052 learning notes - GPIO architecture analysis
- Go限制深度遍历目录下文件
- Leetcode 994, rotten orange
- 缓存淘汰算法初步认识(LRU和LFU)
- On BIM data redundancy theory
- Fastdfs思维导图
- Matlab: psychtoolbox installation
- MySQL进阶之表的增删改查
猜你喜欢

Mathematical modeling column | Part 5: MATLAB optimization model solving method (Part I): Standard Model

Solution: NPM err! code ELIFECYCLE npm ERR! errno 1

UnhandledPromiseRejectionwarning:CastError: Cast to ObjectId failed for value

上海回应“面粉官网是非法网站”:疏于运维被“黑”,警方已立案

Rt-1052 learning notes - GPIO architecture analysis

Leetcode 542, 01 matrix

Unity Odin ProgressBar add value column

Elastic box model

Devaxpress report replay: complete the drawing of conventional two-dimensional report + histogram + pie chart

Vulnhub DC: 1 penetration notes
随机推荐
High paid programmer & interview question series 91 limit 20000 loading is very slow. How to solve it? How to locate slow SQL?
Go language development Daily Fresh Project Day 3 Case - Press Release System II
Identifier CV is not defined in opencv4_ CAP_ PROP_ FPS; CV_ CAP_ PROP_ FRAME_ COUNT; CV_ CAP_ PROP_ POS_ Frames problem
Development of Matlab GUI bridge auxiliary Designer (functional introduction)
How to configure SSH public key in code cloud
Introduction to standardization, regularization and normalization
Plato farm is one of the four largest online IEOS in metauniverse, and the transaction on the chain is quite high
LeetCode 20、有效的括号
Shanghai a répondu que « le site officiel de la farine est illégal »: l'exploitation et l'entretien négligents ont été « noirs » et la police a déposé une plainte
MySQL进阶之数据的增删改查(DML)
Preliminary understanding of cache elimination algorithm (LRU and LFU)
Create vs project with MATLAB
Cmake project under vs2019: calculating binocular parallax using elas method
Plato Farm元宇宙IEO上线四大,链上交易颇高
XXXI` Prototype ` displays prototype properties and`__ proto__` Implicit prototype properties
An error occurs when the addressable assets system project is packaged. Runtimedata is null
Unity ECS dots notes
LeetCode-279-完全平方数
The construction and use of Fortress machine and springboard machine jumpserver are detailed in pictures and texts
Leetcode 709, convert to lowercase