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

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. 

主站蜘蛛池模板: 民勤县| 高州市| 宣威市| 长治县| 灌南县| 翁牛特旗| 日喀则市| 阜康市| 蒲江县| 绥宁县| 英山县| 青州市| 积石山| 甘德县| 竹北市| 都江堰市| 甘德县| 自治县| 改则县| 浦县| 安庆市| 余姚市| 邵阳市| 甘孜| 昭平县| 揭东县| 遵义县| 固始县| 横山县| 赞皇县| 灵川县| 陇南市| 佛冈县| 多伦县| 灵宝市| 大关县| 芜湖市| 罗甸县| 房产| 河北省| 天长市|