当前位置:网站首页>Selenium: element judgment
Selenium: element judgment
2022-08-01 05:10:00 【Mouse A who is not afraid of cats】
Determine if the element exists
1. I have introduced the use of the sleep() method in Python to wait: wait for a certain period of time, let the element be loaded and then execute the code
⑴ But the time when the element is loaded is not fixed, there areThe duration is sometimes short, so the time we wait is not fixed
⑵The best way is: Use some methods in Selenium after a certain period of timeTo determine whether the element is loaded (this is the "explicit wait" to be introduced later)
, just keep waiting
2. In addition, when doing automation, sometimes it is necessary to judge whether the element exists, whether the iframe exists, and whether some pop-up boxes exist, so as to determine whether our operation meets expectations
⑴ ⑴It is equivalent to an assertionway up
3, selenium provides a module dedicated to element judgment: expected_conditions
⑴ ⑴The comparison used by this moduleMany scenes are used together with display waiting, and the method of display waiting is used to determine whether the element appears.
2. As for display waiting, it will be introduced later.
Introduction to common methods
1. There are many types of methods for expected_conditions.Most of them judge elements, but some judge others
method name | Description |
边栏推荐
猜你喜欢
(more than 2022 cattle school four) A - Task Computing + dynamic programming (sort)
2022年湖南工学院ACM集训第六次周测题解
Robot_Framework: Assertion
Robot_Framework:常用内置关键字
The solution to the inconsistency between the PaddleX deployment inference model and the GUI interface test results
冲刺金九银十,Android开发面试(内含面试资料|面试题|源码)
typescript25 - type assertion
Pyspark Machine Learning: Vectors and Common Operations
PAT serie b write the number 1002
初识shell脚本
随机推荐
(2022 Nioke Duo School IV) D-Jobs (Easy Version) (3D prefix or)
Selenium: Introduction
小心你的字典和样板代码
PaddleX部署推理模型和GUI界面测试结果不一致的解决方法
The solution to the inconsistency between the PaddleX deployment inference model and the GUI interface test results
Challenge 52 days to memorize Peppa Pig (Day 01)
移动应用恶意攻击激增500% 三六零天御为APP免费构建安全屏障
可视化全链路日志追踪
Swastika line-by-line parsing and realization of the Transformer, and German translation practice (a)
25. Have you been asked these three common interview questions?
高数 | 【重积分】线面积分880例题
PAT乙级 1001 害死人不偿命的(3n+1)猜想
Selenium:元素等待
罗技鼠标体验记录
vim配置+ctag像source insight一样方便阅读代码
万字逐行解析与实现Transformer,并进行德译英实战(一)
Lawyer Interpretation | Guns or Roses?Talking about Metaverse Interoperability from the Battle of Big Manufacturers
Error: AttributeError: module 'matplotlib' has no attribute 'figure'
Selenium:浏览器操作
「以云为核,无感极速」顶象第五代验证码