TA的每日心情 | 郁闷 2020-8-19 15:27 |
---|
签到天数: 5 天 连续签到: 3 天 [LV.2]测试排长
|
是这样的,想测试分别点击“用户协议”和“隐私协议”,是2个不同的链接,
我使用:(1)driver.findElement(By.xpath("//android.widget.TextView[contains(@text,'用户协议'")).click();
或着(2)driver.findElement(By.linkText("用户协议")).click();
都找不到元素,请问该怎么办?这文字怎么分别点击呢?
UIautomator截图:
使用(1)的报错:
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Finding '//android.widget.TextView[contains(@text,'用户协议'' using 'XPATH' with the contextId: '' multiple: false
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {"status":32,"value":"javax.xml.transform.TransformerException: Expected ,, but found: "}
[AndroidBootstrap] Received command result from bootstrap
使用(2)的报错:
[MJSONWP] Calling AppiumDriver.findElement() with args: ["link text","用户协议","1499983b-ad00-41b3-8ad0-e9abdafbbae3"]
[BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator
[MJSONWP] Encountered internal error running command: InvalidSelectorError: Locator Strategy 'link text' is not supported for this session
|
|