Appium,当时我尝试从Native切换到Webview时出现错误

问题描述 投票:0回答:1

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

输出会话已创建NATIVE_APPWEBVIEW_com.XX.XXX_App错误开始后

enter code here

线程“主”中的异常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',操作系统名称:'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,需要:{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,takesScreenshot: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)

android selenium selenium-chromedriver appium appium-android
1个回答
0
投票

如果我能正确地在您的问题中看到,最新的例外情况如下:未找到可自动执行Chrome '74 .0.3729'的Chromedriver。

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

P.S。如果您已经具有更高版本的ChromeDriver,但是Appium拒绝重新识别它,请使用以下命令启动appium服务器:

appium --chromedriver-executable C:/path-to-your-chromedriver/chromedriver.exe
© www.soinside.com 2019 - 2024. All rights reserved.