当前位置:网站首页>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 |
边栏推荐
猜你喜欢
56:第五章:开发admin管理服务:9:开发【文件上传到,MongoDB的GridFS中,接口】;(把文件上传到GridFS的SOP)
Optional parameters typescript19 - object
About making a progress bar for software initialization for Qt
scheduleWithFixedDelay和scheduleAtFixedRate的区别
pytorch、tensorflow对比学习—计算图和微分机制
Logitech Mouse Experience Record
(2022牛客多校四)H-Wall Builder II(思维)
typescript23-tuple
移动应用恶意攻击激增500% 三六零天御为APP免费构建安全屏障
(2022 Nioke Duo School IV) H-Wall Builder II (Thinking)
随机推荐
typescript21-接口和类型别名的对比
(2022牛客多校四)H-Wall Builder II(思维)
Immutable
typescript23-tuple
可持久化线段树
(2022牛客多校四)K-NIO‘s Sword(思维)
万字逐行解析与实现Transformer,并进行德译英实战(三)
Li Chi's work and life summary in July 2022
typescript24-类型推论
冲刺金九银十,Android开发面试(内含面试资料|面试题|源码)
请问shake数据库中想把源的db0的数据同步到目的db5,参数怎么设置呢?
2022年湖南工学院ACM集训第六次周测题解
Selenium:下拉框操作
关于给Qt做一个软件初始化的进度条
(Codeforce 757) E. Bash Plays with Functions
Swastika line-by-line parsing and realization of the Transformer, and German translation practice (a)
Selenium:浏览器操作
NDK does not contain any platforms问题解决
The method of solving stored procedure table name passing through variable in mysql
4D line-by-line analysis and implementation of Transformer, and German translation into English (3)