- Selenium WebDriver Quick Start Guide
- Pinakin Chaubal
- 108字
- 2021-06-24 18:26:29
The two types of XPaths
Let's now understand what absolute XPaths are and how they differ from relative (customized) XPaths:
- An absolute XPath is the entire path of the WebElement taken from the root node. For example, html/body/div/a.
- A relative or customized XPath is one in which we use the following format. For example, if the div has an id of ABC, then the same absolute XPath will be //div[@id='ABC']/a.
There is an apparent problem with the absolute type of XPath. If the DOM structure changes in the future (for example, if div is removed), then this path will undergo changes.
推薦閱讀
- 全屋互聯:智能家居系統開發指南
- 零起點學Linux系統管理
- Instant Optimizing Embedded Systems using Busybox
- Kali Linux高級滲透測試
- iOS 8開發指南
- Raspberry Pi入門指南
- Linux內核分析及應用
- CSS揭秘
- 鴻蒙HarmonyOS應用開發入門
- Docker容器技術與運維
- Serverless Architectures with Kubernetes
- Gradle Effective Implementations Guide(Second Edition)
- Linux網絡操作系統項目教程(RHEL 6.4/CentOS 6.4)(第2版)
- Windows 11使用方法與技巧從入門到精通
- OpenStack Trove Essentials