无法在appium中使用Content-desc点击按钮

Unable to click on a button using Content-desc in appium

我是 Appium 测试新手。我能够设置所有内容并进行 运行 测试。我使用 UiAutomatorViewer 来访问一些按钮,现在我需要点击一个按钮,但我只是得到了 Cont-desc。我尝试了以下 XPath,但最终出现错误。任何帮助都会很好。

  1. @FindBy(xpath = "//*[@contentDescription='SIGN IN     log in ']")
  2. driver.FindElement(By.XPath("//android.widget.Button[@content-desc='SIGN IN     log in ']")).Click();
  3. driver.FindElement(By.Name('SIGN IN     log in ')).点击();
  4. driver.FindElement(By.Xpath(//*[@Class='android.view.View' 或@content-desc='SIGN IN     log in '])).Click( );

提前谢谢:)

使用以下xpath:

driver.FindElement(By.XPath("//*[contains(@content-desc, 'SIGN')]")).Click();