
from appium import webdriver
# 配置Appium参数
capabilities = {
'platformName': 'Android',
'platformVersion': '7.1.2',
'deviceName': '127.0.0.1:62001',
'appPackage': 'com.android.browser',
'appActivity': 'BrowserActivity',
'automationName': 'UiAutomator2'
}
# 启动Appium服务
driver = webdriver.Remote('http://localhost:4723/wd/hub', capabilities)
# 等待应用加载
driver.implicitly_wait(10)
# 结束测试
driver.quit()