我是移动自动化新手。我正在尝试在我的 Windows 计算机中设置 Appium2.0,但遇到了以下问题(如附件所示)。有人可以帮忙吗?
我尝试使用以下网址在本地运行 Appium 服务器,但最终总是收到 404 错误,如屏幕截图所示: 网址:http://192.168.0.83:4723/ 或 http://127.0.0.1:4723/
这不是你应该如何使用appium服务器。 您应该编写一个使用 appium 的脚本/代码文件,并使用 appium 为您提供的 URL 与 appium 服务器进行对话。
例如,用Python编写连接Android设备的代码:
from appium import webdriver
from appium.options.android.uiautomator2.base import UiAutomator2Options
desired_capabilities = {
'platformName': 'Android',
'platformVersion': '11.0', # Update this to match the Android version of your emulator
'deviceName': 'Pixel_7_API_30', # Update this to match the AVD name of your emulator
'automationName': 'UiAutomator2',
'noReset': True,
'noSign': True,
'avd': 'Pixel_7_API_30',
}
options = UiAutomator2Options()
options.load_capabilities(desired_capabilities)
appium_server_url = 'http://localhost:4723'
driver = webdriver.Remote(appium_server_url, options=options)