用Appium框架做自动化测试,使用Python编写测试脚本时,用find_element_by_xpath()方法来定位元素
这个元素的属性:
所以我是这样定位的:
driver.find_element_by_xpath("//android.widget.FrameLayout[0]/android.widget.TabHost[6]/android.widget.TabWidget[0]/android.widget.RelativeLayout[contains(@index,1)]").click()
结果log显示 Could not find an element using supplied strategy.
这样有什么问题,为什么定位不到?