1. 绝对路径定位,通过firepath(/…/..)
2. 相对路径定位,(//input//)
3. 使用索引定位元素(//input(4))
4. 使用元素的属性值(//input[@type=’submit’][@name=’fuck’])
(//input[@type=’submit’ and @name=’fuck’])
(//input[@type=’sbumit’ or @name=’fuck’])
5. 使用元素名称定位(//input[@type])
6. 使用元素的部分属性值匹配(//input[start-with(@id,’fuck’)])
(//input[ends-with(@id,’fuck’)]) (//input[contains(@id,’fuck’)])
7. 使用任意值来匹配属性及元素(//input[@*=’fuck’])
8. 通过文字定位(//*[text()=’fuck’])