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

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. 

主站蜘蛛池模板: 康定县| 临城县| 聂拉木县| 铁岭市| 贵港市| 平定县| 南投市| 固始县| 福安市| 东丽区| 阿拉善右旗| 尼木县| 苗栗县| 和平区| 德保县| 壤塘县| 贡嘎县| 宜章县| 彭山县| 临颍县| 左贡县| 宜良县| 交城县| 和龙市| 孟州市| 清镇市| 保亭| 团风县| 益阳市| 九江市| 修武县| 徐水县| 南木林县| 兴文县| 甘德县| 南江县| 石泉县| 名山县| 团风县| 陇南市| 罗平县|