Appium查找元素
2016-07-08 15:09
393 查看
记录一些需要记忆的查找元素的内容:
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.
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.
相关文章推荐
- 音频播放
- 图吧地图导航SDK在安卓上的应用案例
- Android开发入门之Notification用法分析
- Android Handler Message总结
- 【转】第一次使用Android Studio时你应该知道的一切配置(二):新建一个属于自己的工程并安装Genymotion模拟器
- Android实时获取当前下载速度
- Swift & OC 混编 浅析
- 一篇文章看懂Android学习最佳路线
- 安卓四大控件之Service
- Android JNI/NDK开发(一)NDK真的很难吗?
- 安卓手册 第一章(环境配置)
- 使用新版Android Studio检测内存泄露和性能
- 【转】第一次使用Android Studio时你应该知道的一切配置
- android:windowSoftInputMode学习笔记
- Java-Android【1】-控制手机震动
- Android应用内存泄露分析、改善经验总结
- android:windowSoftInputMode使用笔记
- Android ListView中子控件的状态保存以及点击子控件改变子控件状态
- Android studio 使用心得(四)---android studio 多渠道打包(二)
- Fragment Can not perform this action after onSaveInstanceState