Appium查找元素
?記錄一些需要記憶的查找元素的內容:
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.?
轉載于:https://www.cnblogs.com/Lihao2013/p/5653440.html
總結
以上是生活随笔為你收集整理的Appium查找元素的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 溪涪和院二期什么时间交房
- 下一篇: 光大炎黄信用卡金卡额度