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

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. 

主站蜘蛛池模板: 泾阳县| 巨野县| 屯留县| 五大连池市| 汝州市| 丰都县| 德清县| 乌拉特前旗| 垫江县| 佳木斯市| 梅州市| 法库县| 德江县| 会宁县| 漯河市| 沙河市| 鹤岗市| 宜宾市| 南充市| 巴青县| 延庆县| 焦作市| 固始县| 滦平县| 岳西县| 巢湖市| 长沙县| 巴彦淖尔市| 稷山县| 屏边| 河源市| 敦化市| 平罗县| 青龙| 伽师县| 蒙自县| 信宜市| 鲁山县| 武平县| 平阴县| 石家庄市|