【问题标题】:Appium, When i try to swtich from Native to Webview at that time error comesAppium,当我尝试从 Native 切换到 Webview 时出现错误
【发布时间】:2020-08-17 16:54:10
【问题描述】:

当我尝试从 Native 切换到 Webview 时出现错误 代码 设置 contextNames = driver.getContextHandles(); for (String contextName : contextNames) {
System.out.println(contextName); //打印出类似 NATIVE_APP、WEBVIEW_com.example.android 等的内容。} } 字符串 setContext = contextNames.toArray()[1].toString(); driver.context(setContext);在此输入代码enter code here

输出 会话已创建 本地应用程序 WEBVIEW_com.XX.XXX_App 错误启动后

​​>
enter code here

线程“main”io.appium.java_client.NoSuchContextException 中的异常:处理命令时发生未知的服务器端错误。原始错误:没有找到可以自动化 Chrome '74.0.3729' 的 Chromedriver。您还可以尝试启用自动 chromedrivers 下载服务器功能。更多详情请见https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/web/chromedriver.md 构建信息:版本:'3.13.0',修订:'2f0d292',时间:'2018-06-25T15:32:14.902Z' 系统信息:主机:'MOHTASIM',ip:'192.168.0.103',os.name:'Windows 10',os.arch:'amd64',os.version:'10.0',java.version:'1.8.0_231 ' 驱动信息:io.appium.java_client.android.AndroidDriver 功能 {app: C:\Users\Admin\eclipse-work..., appPackage: com.avanoo.storyApp, autoAcceptAlerts: true, autoGrantPermissions: true, chromeOptions: {w3c: false}, databaseEnabled: false, desired: {app : C:\Users\Admin\eclipse-work..., autoAcceptAlerts: true, autoGrantPermissions: true, chromeOptions: {w3c: false}, deviceName: Nexus_S_API_29, platformName: android, unicodeKeyboard: true}, deviceApiLevel: 29, deviceManufacturer: Google,deviceModel:为 x86 构建的 Android SDK,deviceName:emulator-5554,deviceScreenDensity:240,deviceScreenSize:480x800,deviceUDID:emulator-5554,javascriptEnabled:true,locationContextEnabled:false,networkConnectionEnabled:true,pixelRatio:1.5,平台:LINUX, platformName:Android,platformVersion:10,statBarHeight:36,takeScreenshot:true,unicodeKeyboard:true,viewportRect:{height:764,left:0,top:36,width:480},警告:{},webStorageEnabled:false} 会话 ID:212580e7-809c-44f2-9b04-204a81695f36 在 io.appium.java_client.AppiumDriver.context(AppiumDriver.java:231) 在 Avanoo.Emulator_test.main(Emulator_test.java:55)

【问题讨论】:

  • 这真的很难阅读,请遵循我们的格式指南,以便 Stackoverflow 的人们可以开始帮助您。见说明:stackoverflow.com/editing-help

标签: android selenium selenium-chromedriver appium appium-android


【解决方案1】:

如果我能正确地看到您的问题,最新的例外情况如下: 没有找到可以自动执行 Chrome '74.0.3729' 的 Chrome 驱动程序。

这只是意味着您的 ChromeDriver 的版本低于您的 Chrome 浏览器,这将无法正常工作。下载相同或只是最新版本的 chrome 驱动程序。

附:如果您已经有更高版本的 ChromeDriver 但 Appium 拒绝识别它,请使用以下命令启动 appium 服务器:

appium --chromedriver-executable C:/path-to-your-chromedriver/chromedriver.exe

【讨论】:

    猜你喜欢
    • 2016-05-08
    • 1970-01-01
    • 2021-09-12
    • 2015-09-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-05-29
    • 2021-07-08
    相关资源
    最近更新 更多