我无法使用Appium

Java在

Android的权限对话框中点击“拒绝”或“允许”按钮.在点击这些按钮之前,是否需要添加任何功能?

以下是代码:

DesiredCapabilities capabilities = new DesiredCapabilities();

capabilities.setCapability("platformName", "Android");

capabilities.setCapability("deviceName", "ASUS_Z00LD");

capabilities.setCapability("platformVersion", "6.0");

capabilities.setCapability("app","");

capabilities.setCapability("browserName", "");

AndroidDriver driver = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);

Thread.sleep(10000);

driver.findElement(MobileBy.id("permission_allow_button")).click();

以下是Eclipse控制台中的错误:

org.openqa.selenium.NoSuchElementException: An element could not be located on the page using the given search parameters. (WARNING: The server did not provide any stacktrace information)

以下是Appium日志:

info: [debug] Responding to client with success: {"status":0,"value":{"platform":"LINUX","browserName":"","platformVersion":"6.0.1","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"app":"/Users/Shiva/Documents/workspace/AndroidPractice/APK/****_Android.apk","browserName":"","platformName":"Android","deviceName":"ASUS_Z00LD","platformVersion":"6.0"},"app":"/Users/Shiva/Documents/workspace/AndroidPractice/APK/****_Android.apk","platformName":"Android","deviceName":"FAAZCY127084"},"sessionId":"b64fd5af-3de5-4299-a2d4-1948fc8e883e"}

info:

info: --> POST /wd/hub/session/b64fd5af-3de5-4299-a2d4-1948fc8e883e/element {"using":"id","value":"permission_allow_button"}

info: [debug] Waiting up to 0ms for condition

info: [debug] Pushing command to appium work queue: ["find",{"strategy":"id","selector":"permission_allow_button","context":"","multiple":false}]

info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"find","params":{"strategy":"id","selector":"permission_allow_button","context":"","multiple":false}}

info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION

info: [debug] [BOOTSTRAP] [debug] Got command action: find

info: [debug] [BOOTSTRAP] [debug] Finding permission_allow_button using ID with the contextId: multiple: false

info: [debug] [BOOTSTRAP] [debug] Using: UiSelector[INSTANCE=0, RESOURCE_ID=com.****.****:id/permission_allow_button]

info: [debug] [BOOTSTRAP] [debug] Using: UiSelector[INSTANCE=0, RESOURCE_ID=android:id/permission_allow_button]

info: [debug] [BOOTSTRAP] [debug] Using: UiSelector[DESCRIPTION=permission_allow_button, INSTANCE=0]

info: [debug] [BOOTSTRAP] [debug] Failed to locate element. Clearing Accessibility cache and retrying.

info: [debug] [BOOTSTRAP] [debug] Finding permission_allow_button using ID with the contextId: multiple: false

info: [debug] [BOOTSTRAP] [debug] Using: UiSelector[INSTANCE=0, RESOURCE_ID=com.****.****:id/permission_allow_button]

info: [debug] [BOOTSTRAP] [debug] Using: UiSelector[INSTANCE=0, RESOURCE_ID=android:id/permission_allow_button]

info: [debug] [BOOTSTRAP] [debug] Using: UiSelector[DESCRIPTION=permission_allow_button, INSTANCE=0]

info: [debug] [BOOTSTRAP] [debug] Returning result: {"status":7,"value":"No element found"}

info: [debug] Condition unmet after 178ms. Timing out.

info: [debug] Responding to client with error: {"status":7,"value":{"message":"An element could not be located on the page using the given search parameters.","origValue":"No element found"},"sessionId":"b64fd5af-3de5-4299-a2d4-1948fc8e883e"}

info:

任何人帮助克服这一点将不胜感激?

appium java 点击事件_java – 无法使用Appium在Android中的权限对话框中单击“允许”按钮...相关推荐

  1. appium java 点击事件_“按钮点击”在Appium Android测试中给出“处理命令时出现未知的服务器端错误 . ”...

    info:[debug]将命令推送到appium工作队列:["element:getSize",{"elementId":"2"}] inf ...

  2. java 点击屏幕_JAVA+Appium 自动化实现手机屏幕滑动点击操作

    背景:App某些页面元素无法通过Appium或其他方式抓取到,无法通过传统方式定位到元素. 原理:获取到当前屏幕的尺寸,在要操作的元素的屏幕位置构造像素点位,进而执行点击或滑动操作. 注:坐标定位时采 ...

  3. java button click事件_java处理按钮点击事件的方法

    java处理按钮点击事件的方法 发布时间:2020-09-17 07:17:02 来源:脚本之家 阅读:70 作者:jingxian 不同的事件源可以产生不同类别的事件.例如,按钮可以发送一个Acti ...

  4. java鼠标点击事件_Java 鼠标点击事件实例

    首先我们应该知道鼠标点击事件怎么实现 其部分代码如下 if (anyEvent.getButton() == MouseEvent.BUTTON1) {} e.getButton()返回值分别为NOB ...

  5. java的按钮点击事件_java处理按钮点击事件的方法

    不同的事件源可以产生不同类别的事件.例如,按钮可以发送一个ActionEvent对象,而窗口可以发送WindowEvent对象. AWT时间处理机制的概要: 1. 监听器对象是一个实现了特定监听器接口 ...

  6. java 双击触发事件_java鼠标双击事件怎么实现

    很多人都学习过java,但是你知道java鼠标双击事件怎么实现吗,跟着学习啦小编一起学习ava鼠标双击事件. java鼠标双击事件的实现方法 鼠标的单双击事件在很多时候对我们帮助很大,但是在JAVA中 ...

  7. java 过滤js事件_java中的过滤器与监听器

    过滤器: Filter本身并不生成请求和响应对象,只是提供过滤功能. Filter能够在Servlet被调用之前检查Request对象,并修改Request Header和Request内容:在Ser ...

  8. java swing 删除事件_java swing清除事件队列

    是否可以以标准方式执行此操作? 这是场景. >开始在EDT中做一些昂贵的事情(EDT被阻止,直到昂贵的操作结束). >当EDT被阻止时,用户继续单击/拖动鼠标按钮.所有鼠标操作都记录在某处 ...

  9. appium java 点击坐标_appium定位元素java篇【转】

    1.关于没有name,没有ID的元素的定位---通用篇 解题思路: 因为没有name,id:其实剩下的选择已不多,要么xpath,要么className.xpath木有好印象(稳定性不高,加之1.0x ...

最新文章

  1. 利用FreeImage将gif图像转为opencv中的Mat
  2. 浅析响应式网站建设的注意要点
  3. C++ Primer 5th笔记(chap 16 模板和泛型编程)std::move
  4. python tempfile 创建临时目录
  5. 总结数据库设计中的14个技巧
  6. OpenCV立体声匹配 stereo matching将L和R图像转换为视差和点云的实例(附完整代码)
  7. [html] HTML5的触屏事件有哪些?
  8. PHP简单方法判断文件是否是图片 PHP best way to check if file is an image
  9. Linux系统日志详解
  10. 台式电脑cpu排行榜_微星新款游戏台式电脑亮相 配备英特尔第十代CPU
  11. java cygwin 乱码_Cygwin中文乱码的解决方案
  12. LeetCode 1055. 形成字符串的最短路径
  13. Java文件操作——简单文件搜索优化版本Lambda优化
  14. Lambda拉姆达表达式使用学习
  15. oppo手机显示服务器连接错误,OPPO手机连不上wifi怎么办?OPPO连不上wifi的四种解决方法...
  16. 如何在Mac上裁剪图片
  17. 【小学信息技术教资面试】《蜻蜓立小荷》教案
  18. android 内部存储 共享,android存储:共享参数、内部存储、拓展存储
  19. 科技版《碟中谍》:偷鸡摸狗的科技巨头们
  20. Mutable variable is accessible from closure

热门文章

  1. OpenCV学习笔记(十一):阈值化:threshold(),adaptivethreshold()
  2. QT学习笔记(五):Qt5的8种标准对话框示例
  3. Opencv和C++实现canny边缘检测
  4. Android之数据库操作
  5. 一篇文章搞懂数据仓库:数据仓库架构-Lambda和Kappa对比
  6. Web.XML配置详细说明
  7. C++学习之路 | PTA乙级—— 1020 月饼 (25分)(精简)
  8. FreeRTOS学习及移植笔记之一:开始FreeRTOS之旅
  9. mysql用户添加_MySQL用户添加
  10. 顶级程序员的心得 Coders at Work (III)