zoukankan      html  css  js  c++  java
  • Appium_Java运行测试脚本时问题汇总

    问题一、
    java.lang.NoClassDefFoundError: org/openqa/selenium/remote/SessionNotFoundException
    Caused by: java.lang.ClassNotFoundException: org.openqa.selenium.remote.SessionNotFoundException
    解决方法:
    pom文件中只配置java-clientJ即可,把selenium相关的配置都移除
    问题二、
    运行appium-doctor提示需要安装opencv4nodejs,命令为: npm i -g opencv4nodejs
    参考地址:https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/image-comparison.md
    问题三、
    Message: An unknown server-side error occurred while processing the command. Original error: zipAlignApk failed. Original error: Command 'android-sdk-windows_r24.3.2\build-tools\28.0.3\zipalign.exe -f 4 nodejs\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-debug-androidTest.apk Local\Temp\2019023-21080-1lyy0jl.0z4j\appium.tmp' exited with code 1. Stdout: ''; Stderr: 'Unable to open 'nodejs ode_modulesappium ode_modulesappium-uiautomator2-serverapksappium-uiautomator2-server-debug-androidTest.apk' as zip archive
    处理方法:
    把nodejs->node_modules下的appium-uiautomator2-driver跟server都删除了,把appium下node_modules下的appium-uiautomator2-driver跟server也都删除了,此时命令行启动appium会提示缺少appium-uiautomator2-driver,于是在nodejs->node_modules->appium->node_modules下再次安装appium-uiautomator2-driver,执行完成后再次运行脚本出现问题四;
    实际原因为appium-uiautomator2-server未安装正确;
    问题四:
    selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: this.adb.getApplicationInstallState is not a function
    参考: https://github.com/appium/appium/issues/12061
    命令行启动appium未解决此问题,安装Appium 桌面版本,此问题解决,同时Appium 在android 8.0上切换Activity无法识别元素的问题也解决了;
    问题五:
    opencv4nodejs安装
    解决方法: https://blog.csdn.net/qq_37385726/article/details/80448322
    问题六、
    org.jetbrains.plugins.gradle.tooling.util.ModuleComponentIdentifierImpl, gradle 5上会报此错误;
    android studio 3.2,gradle 4.10.3
    解决方法:
    Android Studio->Settings->Build,Execution,Deployment->Gradle -> Use local Gradle 选择4.10.3就可以了
    参考:https://github.com/gradle/gradle/issues/8088
    问题七:
    若直接安装Appium desktop版本1.10.1,使用Uiautomator2没有问题,则可以i把桌面版本的node-modules复制到终端安装的appium对应目录下,此时终端安装的appium可以正常使用Uiautomator2了;

  • 相关阅读:
    idea 中使用 svn
    [剑指offer] 40. 数组中只出现一次的数字
    [剑指offer] 39. 平衡二叉树
    [剑指offer] 38. 二叉树的深度
    [剑指offer] 37. 数字在排序数组中出现的次数
    [剑指offer] 36. 两个链表的第一个公共结点
    [剑指offer] 35. 数组中的逆序对
    vscode在win10 / linux下的.vscode文件夹的配置 (c++/c)
    [剑指offer] 34. 第一个只出现一次的字符
    [剑指offer] 33. 丑数
  • 原文地址:https://www.cnblogs.com/jiguanghover/p/10218048.html
Copyright © 2011-2022 走看看