gpt4 book ai didi

android - 我无法点击文字

转载 作者:太空宇宙 更新时间:2023-11-03 10:58:24 25 4
gpt4 key购买 nike

我试图点击“女性”,但我不知道为什么它没有点击它。我正在使用 java-client 5.0.4appium 1.8.1jdk1.8

谁能帮帮我?

我的代码如下。

driver.findElementByXPath(("//android.widget.TextView[@text='WOMEN']")).click();

enter image description here

日志在这里

[HTTP] 
[HTTP] --> POST /wd/hub/session/03f470f3-6c91-496c-a072-9c2ff1fb0b66/element
[HTTP] {"using":"xpath","value":"//android.widget.TextView[@text='WOMEN']"}
[W3C] Calling AppiumDriver.findElement() with args: ["xpath","//android.widget.TextView[@text='WOMEN']","03f470f3-6c91-496c-a072-9c2ff1fb0b66"]
[BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator
[BaseDriver] Waiting up to 0 ms for condition
[AndroidBootstrap] Sending command to android: {"cmd":"action","action":"find","params":{"strategy":"xpath","selector":"//android.widget.TextView[@text='WOMEN']","context":"","multiple":false}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {"cmd":"action","action":"find","params":{"strategy":"xpath","selector":"//android.widget.TextView[@text='WOMEN']","context":"","multiple":false}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: find
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Finding '//android.widget.TextView[@text='WOMEN']' using 'XPATH' with the contextId: '' multiple: false

最佳答案

您可以使用更可靠的方式使用 resource-id 和下面提到的命令

driver.findElement(By.id("complete text in resource-id")).click();

关于android - 我无法点击文字,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51415368/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com