官术网_书友最值得收藏!

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. 

主站蜘蛛池模板: 武邑县| 宜宾市| 沅陵县| 阿拉善右旗| 徐汇区| 惠州市| 新丰县| 丽江市| 尉犁县| 阿克苏市| 高平市| 天津市| 武强县| 廊坊市| 五峰| 方山县| 介休市| 罗甸县| 吴江市| 永登县| 儋州市| 含山县| 关岭| 临湘市| 教育| 常德市| 当雄县| 景德镇市| 山阴县| 诏安县| 定安县| 江阴市| 富蕴县| 铅山县| 庆阳市| 枞阳县| 普定县| 苗栗市| 永嘉县| 凤冈县| 仪陇县|