我目前正在使用Appium和android仿真器进行自动化测试。
应用程序详细信息:
App Version 1.18.3
Electron: 7.2.4
Node.js: 12.8.1
仿真器详细说明
Name: Pixel 2 Q 10.0 - API 29
OS: Q 10.0 - API 29
Processor: x86
Memory: 1GB
Resolution: 1080x1920 420 dpi
需要在脚本中设置的功能
app_file_path = "https://.../selendroid-test-app.apk"
platform_version = "10.0"
platform_name = "Android"
appium_port = "4723"
device_name = "Android Emulator"
desired_caps = {
caps: {
automationName: "UIAutomator2",
app: app_file_path,
platformName: platform_name,
platformVersion: platform_version,
deviceName: device_name,
newCommandTimeout: 3600,
autoGrantPermissions: true
},
appium_lib: {
port: appium_port
}
}
driver = Appium::Driver.new(desired_caps).start_driver
在运行这个ruby脚本时,我观察到模拟器上的屏幕显示了以下内容并阻止了我的自动化。有没有其他方法来绕过这个屏幕,因为它阻碍了自动化。许多经历过此错误的人通过将自动赠款权限设置为true解决了这一问题。但是,对于版本10和11的android仿真器来说,这是行不通的。
请告诉我如何解决这个问题。
发布于 2020-11-20 08:44:42
我能够通过在所需的功能中将fullReset设置为true来解决这个问题。现在我想要的功能如下所示
desired_caps = {
caps: {
automationName: "UIAutomator2",
app: app_file_path,
platformName: platform_name,
platformVersion: platform_version,
deviceName: device_name,
newCommandTimeout: 3600,
autoGrantPermissions: true,
fullReset: true
},
appium_lib: {
port: appium_port
}
}
https://stackoverflow.com/questions/64925830
复制相似问题