- 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.
推薦閱讀
- 電腦組裝與系統安裝
- Citrix XenApp Performance Essentials
- Mastering vRealize Operations Manager(Second Edition)
- 鴻蒙生態:開啟萬物互聯的智慧新時代
- Windows Server 2012 Hyper-V Cookbook
- PLC控制系統應用與維護
- Linux操作系統應用編程
- Linux就該這么學
- 直播系統開發:基于Nginx與Nginx-rtmp-module
- Windows Server 2012網絡操作系統項目教程(第4版)
- 深入淺出Node.js
- Linux命令行大全(第2版)
- Social Data Visualization with HTML5 and JavaScript
- Linux基礎使用與案例
- Linux內核API完全參考手冊(第2版)