当前位置:网站首页>Selenium: element positioning
Selenium: element positioning
2022-08-01 05:08:00 【Mouse A who is not afraid of cats】
Selenium automated testing
1. Selenium's control of web pages is based on various front-end elements. In the process of use, the positioning of elements is the basis. Subsequent automatic control can only be carried out when the corresponding elements are accurately captured
⑴The previous introductionThe HTML of the front-end web page is composed of many tag elements in a hierarchical structure. For a certain tag, its position in the entire web page HTML is unique. Therefore, this tag element can be accurately found and manipulated by some methods.
⑵ UseThe find_element_by_* function of the WebDriver object can locate a Web page element
⑶ Use the find_elements_by_* function of the WebDriver object to locate multiple Web page elements
2. Automated testing steps: positioning elements -> operating elements -> verifying operation results -> recording test results
Locating a single element
1. When operating the browser, we only need to locate a certain element, so WebDriver provides many methods for locating a single element
2. After using Selenium to open a web page (the return value of the get method), it will return a WebDriver object, which can be usedThe positioning method below to locate an element
3. These methods locate elements through an attribute of the label, so these methods have a unified return value:
⑴ ⑴Find the element: Returns the WebElement object of the corresponding element
⑵Element not found: returns NoSuchElementException
4. After locating an element, we need to perform some operations on this element, which will be used here
边栏推荐
- NDK does not contain any platforms问题解决
- 华为Android开发面试后得出的面试秘诀
- DL-31/6电流继电器
- 类神经网络训练不起来怎么办
- [target detection] YOLOv7 theoretical introduction + practical test
- 这里有110+公开的专业数据集
- LeetCode 1189. “气球” 的最大数量
- 干货!如何使用仪表构造SRv6-TE性能测试环境
- Swastika line-by-line parsing and realization of the Transformer, and German translation practice (a)
- 6-23漏洞利用-postgresql代码执行利用
猜你喜欢

typescript25-类型断言

typescript24 - type inference

The difference between scheduleWithFixedDelay and scheduleAtFixedRate

scheduleWithFixedDelay和scheduleAtFixedRate的区别

FFmpeg 搭建本地屏幕录制环境

数组问题之《下一个排列》、《旋转图像》以及二分查找之《搜索二维矩阵》

typescript27 - what about enumeration types

I met a shell script

风险策略调优中重要的三步分析法

Typescript22 - interface inheritance
随机推荐
(2022牛客多校四)N-Particle Arts(思维)
Selenium:简介
SL-12/2过流继电器
MySQL Practice Summary -
Selenium:表单切换
UE4 从鼠标位置射出射线检测
In the shake database, I want to synchronize the data of the source db0 to the destination db5, how to set the parameters?
Pyspark Machine Learning: Vectors and Common Operations
Robot_Framework:关键字
剑指 Offer 68 - II. 二叉树的最近公共祖先
【目标检测】YOLOv7理论简介+实践测试
typescript24-类型推论
请问shake数据库中想把源的db0的数据同步到目的db5,参数怎么设置呢?
罗技鼠标体验记录
typescript28 - value of enumeration type and data enumeration
Typescript20 - interface
Pyspark机器学习:向量及其常用操作
Power button (LeetCode) 212. The word search II (2022.07.31)
MySQL-Data Definition Language-DDLdatebase define language
状态压缩dp