记录一些需要记忆的查找元素的内容:

1. driver.findElement(By.name("DELETE");   //We can use the DELETE text to locate the DELETE button as Name。

2. driver. findElementByAccessibilityId("plus");  //We can use content-desc as AccId to perform an action on the + sign.

3. For example, resource-id as com.android.calculator2:id/equal. We can use resource-id as UIAuto to perform an action on the = sign. This is how the command will look:WebElement equal=driver. findElementByAndroidUIAutomator("new UiSelector().resourceId(\"com.android.calculator2:id/equal\")";

Another example is to pick content-desc as equals, so the command will look like this: WebElement equal=driver. findElementBy.AndroidUIAutomator("new UiSelector().description(\"equals\")");

4. 

相关文章:

  • 2022-03-01
  • 2021-08-17
  • 2021-12-26
  • 2021-12-26
  • 2021-12-26
  • 2022-03-03
  • 2021-10-05
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-09-24
  • 2022-12-23
  • 2021-12-11
  • 2021-04-21
相关资源
相似解决方案