当前位置:网站首页>Eight principles of element positioning
Eight principles of element positioning
2022-06-26 01:41:00 【NitefullSand】
Eight principles of element positioning
1.id: Similar to a person's ID number , Generally correct , Will not be associated with other labels id Repeat .
2.name The name of the person's ID card , There may be repeated , If you encounter more than one of the same name The label of , Then return to the first name value .
3.class: Style of label , Such as input、image etc. , This method is also not commonly used , because className Too much content , And there is a space separator . Therefore, it is easy to parse errors in positioning .
4.TagName: Locate according to the tag name , However, there are multiple tag names on the same page , Use only under certain circumstances , For example, it is occasionally used to obtain form data .
5.xpath: One of the most frequently used positioning methods , A positioning method similar to a file management system , Divide the elements into paths , Locate elements by path .
Absolute path :html/body/div/div/span/input
Relative paths ://*[@id="kw"] (// Represents the root directory 'html',* All elements ,@id Indicates that the element has a id attribute ,kw Represents the value of the property )
The method in IE in , Can't support .
6.CSS selctor For only IE Browser web The system performs element positioning , Recommended use .
According to the label id Look for the element :input#su (input Represents the tag name of the element to be found ,# That represents the label id,su Represents the attribute value of an element )
Find elements based on other attributes of the tag :input[name="wd"](input Represents the tag name of the element to be found ,[name=] That represents the label name attribute ,wd Represents the value of the property ),
If multiple attributes are searched together, multiple [] Express , for example input[name="wd"][class="s_ipt"]
7.LinkText: Positioning method dedicated to positioning links .
8.PartiaLinkText: Positioning method dedicated to positioning links , Fuzzy location . Be similar to sql Medium like %%
automated testing :
During the test , Choose the most appropriate method , The most stable and effective , Run the method with the highest success rate to locate elements .
边栏推荐
- Oracle数据库完全卸载步骤(暂无截图)
- How to search papers in a certain field
- Abnova丨CMV CISH 探头解决方案
- APP测试与WEB测试的区别
- Set set!! Review quickly -- MySQL addition, deletion, modification and query, internal, left and right connection review notes
- 从在浏览器的输入框输入一个网址,到看到网页的内容,这个过程中发生了什么?
- --SQL of urban cultivation manual -- Chapter 1 basic review
- [Excel知识技能] Excel数据类型
- Can bus transceiver principle
- 22. pixel remapping
猜你喜欢

Textcnn paper Interpretation -- revolutionary neural networks for sense classification

STM32GPIO
![[excel knowledge and skills] Excel data type](/img/f6/e1ebe033d1a2a266ebda00b10098ed.png)
[excel knowledge and skills] Excel data type

Postman斷言對應脚本的解釋

--SQL of urban cultivation manual -- Chapter 1 basic review

Abnova丨CMV CISH 探头解决方案

Assertion of postman interface test
![[flower carving experience] 11 start esp32c3](/img/ff/d7c266893ef4ef70c6536085927e0e.jpg)
[flower carving experience] 11 start esp32c3

MySQL图书借阅系统项目数据库建库表语句(组合主键、外键设置)

readv & writev
随机推荐
Set set!! Review quickly -- MySQL addition, deletion, modification and query, internal, left and right connection review notes
I2C protocol
图文大师印章简易制作
STM32GPIO
Oracle数据库开启备份准备工作
Longitude and latitude multipoint acquisition center point has been solved
Oracle數據庫完全卸載步驟(暫無截圖)
Laravel basic course routing and MVC - controller
21. Hoff circle transformation
Common basic Oracle commands
Forgotten Jieba participle
[visual studio code] vscode shortcut keys
ActivityManager kill reason
弹性蛋白酶的用途和化学性质
Laravel basic course routing and MVC - routing
MySQL例题一 综合案例(多条件组合查询)
CityJSON
recv & send
GUN make (3) Makefile的规则
集合集合!!快来复习--mysql增删改查,内、左右连接 复习笔记