这里写目录标题
一、xpath函数
1、包含-contains()
contains()函数匹配属性值中包含的字符串 //*[contains(@属性,"属性值")]
二、xpath轴
父子
爷孙
祖先
兄弟姐妹
1、获取当前节点的父节点
方式一://*[@text="HK"]/..
方式二://*[@text="HK"]/parent::*
案例1:通过父节点查找子节点
定义父节点
//*[@resource-id="com.xueqiu.android:id/title_container"]
通过父节点查找子节点,子节点有多个,找第二个子节点
//*[@resource-id="com.xueqiu.android:id/title_container"]/android.widget.FrameLayout[2]
案例2:通过子节点查找父节点
需求:通过09988元素获取价格
def test_get_current