测试人社区

appium启动web app时通过mumu模拟器本地浏览器打开百度网址时,报如下错误

代码:

from appium import webdriver
import pytest

class TestBrowser:

def setup(self):
    desired_caps = {}
    # 系统类型
    desired_caps['platformName'] = 'Android'
    # 模拟器地址
    desired_caps['deviceName'] = '127.0.0.1:7555'
    # 测试包名
    desired_caps['browserName'] = 'Browser'
    # desired_caps['chromedriverExecutable'] = 'C:\\software\\chromedriver'
    # 首次进入的页面
    # 设置支持输入为中文
    # desired_caps['unicodeKeyBoard'] = 'true'
    # desired_caps['resetKeyBoard'] = 'true'
    # # 初始设置,缓存是否清理设置
    # desired_caps['noReset'] = 'true'
    # # # 重启app设置
    # desired_caps['dontStopAppOnReset'] = 'true'
    # # 跳过安装设置
    # desired_caps['skipDeviceInitialization'] = 'true'
    self.driver = webdriver.Remote("http://127.0.0.1:4723/wd/hub", desired_caps)
    self.driver.implicitly_wait(15)

def teardown(self):
    time.sleep(20)
    self.driver.quit()

def test_dw(self):
    self.driver.get("http://m.baidu.com")

报错:
selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: Error getting device API level. Original error: Error executing adbExec. Original error: ‘Command ‘C:\software\android-sdk_r24.4.1-windows\android-sdk-windows\platform-tools\adb.exe -P 5037 -s 127.0.0.1:7555 shell getprop ro.build.version.sdk’ timed out after 20000ms’. Try to increase the 20000ms adb execution timeout represented by ‘adbExecTimeout’ capability

  1. 提供下报错的详细信息(appium日志和pycharm控制台日志)。
  2. 检查下模拟器内是否有自带浏览器。
  3. 检查下手机浏览器对应的driver版本与本地的是否匹配。

appium server报错信息
pycharm运行日志报错信息.txt (19.4 KB)

问题解决了 老师

原因是什么呢

版本问题,chromedriver版本不对,但是我看录播课里面讲的chromedirver是向上兼容的,这块我有点疑惑