在Appium中运行移动自动化脚本时出错

时间:2019-09-12 07:44:32

标签: android selenium-webdriver appium ui-automation appium-android

enter image description here

在appium中运行自动化脚本时出错。

enter image description here

enter image description here

我正在Windows桌面系统上运行带有以下软件设置的移动自动化脚本。

软件设置:

1.Android Studio

2.Appium

3。手机/平板电脑已连接到系统

4.Selenium / Appium自动化驱动程序代码

错误

apksigner stderr: ERROR: Registry editing has been disabled by your administrator.
Exception in thread "main" java.nio.file.AccessDeniedException: C:\Program Files\Appium\resources\app\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-debug-androidTest.apk
Cannot use apksigner tool for signing. Defaulting to sign.jar. Original error: Command 'apksigner.bat sign --key 'C:\\Program Files\\Appium\\resources\\app\\node_modules\\appium\\node_modules\\appium-adb\\keys\\testkey.pk8' --cert 'C:\\Program Files\\Appium\\resources\\app\\node_modules\\appium\\node_modules\\appium-adb\\keys\\testkey.x509.pem' 'C:\\Program Files\\Appium\\resources\\app\\node_modules\\appium\\node_modules\\appium-uiautomator2-server\\apks\\appium-uiautomator2-server-debug-androidTest.apk'' exited with code 1; StdErr: ERROR: Registry editing has been disabled by your administrator.
[warn] [35m[ADB][39m Exception in thread "main" java.nio.file.AccessDeniedException: C:\Program Files\Appium\resources\app\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-debug-androidTest.apk
Unable to remove port forward 'Error executing adbExec. Original error: 'Command 'C\:\\Users\\Sumit.Chouhtel\\AppData\\Local\\Android\\sdk\\platform-tools\\adb.exe -P 5037 -s RFXTBIC00014974 forward --remove tcp\:8200' exited with code 1'; Stderr: 'adb.exe: error: listener 'tcp:8200' not found'; Code: '1''
[debug] [35m[BaseDriver][39m Event 'newSessionStarted' logged at 1568214375516 (20:36:15 GMT+0530 (India Standard Time))

2 个答案:

答案 0 :(得分:0)

尝试使用以下步骤启用注册表编辑(假设您使用Windows 10)

  1. Win + R(打开运行命令窗口)

  2. 运行gpedit.msc

  3. 转到用户配置>管理模板>系统>阻止访问注册表编辑工具

  4. 双击并将其设置为“禁用”

enter image description here

实现此https://www.techperiod.com/registry-edit-disabled-by-virus-fix/

的其他方法

答案 1 :(得分:0)

我有以下解决方案:

在安装Appium Desktop应用程序时,需要单击“仅对我来说”选项。 (如果我们选择“针对所有用户”选项,那么Appium运行将出错)。