没有找到可以自动化Chrome'53.0.2785'的Chromedriver。



>问题:我正在尝试在 android 模拟器上运行 appium 自动化,该应用程序启动但出错,显示找不到 chromedriver。

我能够更早地跑步,就像上个月和所有一样。但是现在它给我带来了一个错误,可能是因为对appium或chromedriver或android进行了一些更新。

Appium 版本 - 1.8.1 操作系统 : 苹果电脑 平台 : 安卓

尝试了一些选项,例如降级appium版本,将chromedriver版本更改为较低的版本。各种帖子建议,没有一个有明确和适当的解决方法

[debug] [ADB] Device API level: 24
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/Users/lokesh/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","emulator-5554","shell","am","start","-W","-n","com.sparkletech.app/com.sparkletech.app.MainActivity","-S","-a","android.intent.action.MAIN","-c","android.intent.category.LAUNCHER","-f","0x10200000"]
[debug] [AndroidDriver] Not cleaning generated files. Add `clearSystemFiles` capability if wanted.
[Appium] New AndroidDriver session created successfully, session fa4f13cc-80b2-4db1-b417-cd13798ee4af added to master session list
[debug] [BaseDriver] Event 'newSessionStarted' logged at 1535255463650 (13:51:03 GMT+1000 (Australian Eastern Standard Time))
[debug] [MJSONWP] Responding to client with driver.createSession() result: {"platform":"LINUX","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"appPackage":"com.sparkletech.app","app":null,"noReset":true,"deviceName":"emulator-5554","appActivity":"com.sparkletech.app.MainActivity","build":"local-null","platformVersion":"7.0","name":"Swipe on Onboarding Carousel","browserName":"","platformName":"Android","printPageSourceOnFindFailure":"true","browserstack.debug":"true"},"appPackage":"com.sparkletech.app","app":null,"noReset":true,"deviceName":"emulator-5554","appActivity":"com.sparkletech.app.MainActivity","build":"local-null","platformVersion":"7.0","name":"Swipe on Onboarding Carousel","browserName":"","platformName":"Android","printPageSourceOnFindFailure":"true","browserstack.debug":"true","deviceUDID":"emulator-5554","deviceScreenSize":"1080x1920","deviceModel":"Android SDK built for x86","deviceManufacturer":"Google"}
[HTTP] <-- POST /wd/hub/session 200 5238 ms - 1071 
[HTTP] --> GET /wd/hub/session/fa4f13cc-80b2-4db1-b417-cd13798ee4af/contexts {}
[debug] [MJSONWP] Calling AppiumDriver.getContexts() with args: ["fa4f13cc-80b2-4db1-b417-cd13798ee4af"]
[debug] [AndroidDriver] Getting a list of available webviews
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/Users/lokesh/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","emulator-5554","shell","cat","/proc/net/unix"]
[debug] [AndroidDriver] WEBVIEW_9844 mapped to pid 9844
[debug] [AndroidDriver] Getting process name for webview
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/Users/lokesh/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","emulator-5554","shell","ps"]
[debug] [AndroidDriver] Parsed pid: '9844' pkg: 'S' from
[debug] [AndroidDriver]     USER      PID   PPID  VSIZE  RSS   WCHAN            PC  NAME
[debug] [AndroidDriver]     u0_a82    9844  1373  1510484 92776 futex_wait 00000000 S com.sparkletech.app
[debug] [AndroidDriver] Returning process name: 'S'
[debug] [AndroidDriver] Found webviews: ["WEBVIEW_S"]
[debug] [AndroidDriver] Available contexts: ["NATIVE_APP","WEBVIEW_S"]
[debug] [MJSONWP] Responding to client with driver.getContexts() result: ["NATIVE_APP","WEBVIEW_S"]
[HTTP] <-- GET /wd/hub/session/fa4f13cc-80b2-4db1-b417-cd13798ee4af/contexts 200 161 ms - 98 
[HTTP] --> POST /wd/hub/session/fa4f13cc-80b2-4db1-b417-cd13798ee4af/context {"name":"WEBVIEW_S"}
[debug] [MJSONWP] Calling AppiumDriver.setContext() with args: ["WEBVIEW_S","fa4f13cc-80b2-4db1-b417-cd13798ee4af"]
[debug] [AndroidDriver] Getting a list of available webviews
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/Users/lokesh/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","emulator-5554","shell","cat","/proc/net/unix"]
[debug] [AndroidDriver] WEBVIEW_9844 mapped to pid 9844
[debug] [AndroidDriver] Getting process name for webview
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/Users/lokesh/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","emulator-5554","shell","ps"]
[debug] [AndroidDriver] Parsed pid: '9844' pkg: 'S' from
[debug] [AndroidDriver]     USER      PID   PPID  VSIZE  RSS   WCHAN            PC  NAME
[debug] [AndroidDriver]     u0_a82    9844  1373  1518292 98828 binder_thr 00000000 S com.sparkletech.app
[debug] [AndroidDriver] Returning process name: 'S'
[debug] [AndroidDriver] Found webviews: ["WEBVIEW_S"]
[debug] [AndroidDriver] Available contexts: ["NATIVE_APP","WEBVIEW_S"]
[debug] [AndroidDriver] Connecting to chrome-backed webview context 'WEBVIEW_S'
[debug] [AndroidDriver] A port was not given, using random port: 8000
[debug] [Chromedriver] Changed state to 'starting'
[Chromedriver] Set chromedriver binary as: /usr/local/lib/node_modules/appium/node_modules/appium-chromedriver/chromedriver/mac/chromedriver
[debug] [Chromedriver] Killing any old chromedrivers, running: pkill -15 -f "/usr/local/lib/node_modules/appium/node_modules/appium-chromedriver/chromedriver/mac/chromedriver.*--port=8000"
[Chromedriver] No old chromedrivers seemed to exist
[debug] [Chromedriver] Cleaning any old adb forwarded port socket connections
[debug] [ADB] List forwarding ports
[debug] [ADB] Running '/Users/lokesh/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","emulator-5554","forward","--list"]
[debug] [ADB] Removing forwarded port socket connection: 12264 
[debug] [ADB] Running '/Users/lokesh/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","emulator-5554","forward","--remove","tcp:12264"]
[Chromedriver] Spawning chromedriver with: /usr/local/lib/node_modules/appium/node_modules/appium-chromedriver/chromedriver/mac/chromedriver --url-base=wd/hub --port=8000 --adb-port=5037 --verbose
[debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8000/wd/hub/status] with no body
[debug] [JSONWP Proxy] Got response with status 200: "{"sessionId":"","status":0,"value":{"build":{"version":"alpha"},"os":{"arch":"x86_64","name":"Mac OS X","version":"10.13.4"}}}"
[debug] [JSONWP Proxy] Proxying [POST /session] to [POST http://127.0.0.1:8000/wd/hub/session] with body: {"desiredCapabilities":{"chromeOptions":{"androidPackage":"com.sparkletech.app","androidUseRunningApp":true,"androidDeviceSerial":"emulator-5554"}}}
[debug] [Chromedriver] Webview version: 'Chrome/51.0.2704.90'
[debug] [JSONWP Proxy] Got response with status 200: {"sessionId":"7e665c4f7cb6a80ad2d9589e51504765","status":33,"value":{"message":"session not created exception: Chrome version must be >= 65.0.3325.0n  (Driver info: chromedriver=2.38.552518 (183d19265345f54ce39cbb94cf81ba5f15905011),platform=Mac OS X 10.13.4 x86_64)"}}
[debug] [JSONWP Proxy] Proxying [POST /session] to [POST http://127.0.0.1:8000/wd/hub/session] with body: {"desiredCapabilities":{"chromeOptions":{"androidPackage":"com.sparkletech.app","androidUseRunningApp":true,"androidDeviceSerial":"emulator-5554"}}}
[debug] [Chromedriver] Webview version: 'Chrome/51.0.2704.90'
[debug] [JSONWP Proxy] Got response with status 200: {"sessionId":"5393e82cdbef8206a130d6f1e3fac315","status":33,"value":{"message":"session not created exception: Chrome version must be >= 65.0.3325.0n  (Driver info: chromedriver=2.38.552518 (183d19265345f54ce39cbb94cf81ba5f15905011),platform=Mac OS X 10.13.4 x86_64)"}}
[debug] [JSONWP Proxy] Proxying [POST /session] to [POST http://127.0.0.1:8000/wd/hub/session] with body: {"desiredCapabilities":{"chromeOptions":{"androidPackage":"com.sparkletech.app","androidUseRunningApp":true,"androidDeviceSerial":"emulator-5554"}}}
[debug] [Chromedriver] Webview version: 'Chrome/51.0.2704.90'
[debug] [JSONWP Proxy] Got response with status 200: {"sessionId":"57883c05b8d4fe0b9ff9bb3c5121b4ee","status":33,"value":{"message":"session not created exception: Chrome version must be >= 65.0.3325.0n  (Driver info: chromedriver=2.38.552518 (183d19265345f54ce39cbb94cf81ba5f15905011),platform=Mac OS X 10.13.4 x86_64)"}}
[debug] [JSONWP Proxy] Proxying [POST /session] to [POST http://127.0.0.1:8000/wd/hub/session] with body: {"desiredCapabilities":{"chromeOptions":{"androidPackage":"com.sparkletech.app","androidUseRunningApp":true,"androidDeviceSerial":"emulator-5554"}}}
[debug] [Chromedriver] Webview version: 'Chrome/51.0.2704.90'
[debug] [JSONWP Proxy] Got response with status 200: {"sessionId":"28397955268db8b06d4a2dc3055ed85a","status":33,"value":{"message":"session not created exception: Chrome version must be >= 65.0.3325.0n  (Driver info: chromedriver=2.38.552518 (183d19265345f54ce39cbb94cf81ba5f15905011),platform=Mac OS X 10.13.4 x86_64)"}}
[Chromedriver] Chromedriver exited unexpectedly with code null, signal SIGTERM
[debug] [Chromedriver] Changed state to 'stopped'
[Chromedriver] Unable to automate Chrome version because it is too old for this version of Chromedriver.
[Chromedriver] Please see 'https://github.com/appium/appium/blob/master/docs/en/advanced-concepts/chromedriver.md'
[Chromedriver] Error: session not created exception: Chrome version must be >= 65.0.3325.0
(Driver info: chromedriver=2.38.552518 (183d19265345f54ce39cbb94cf81ba5f15905011),platform=Mac OS X 10.13.4 x86_64)
at Chromedriver.callee$2$0$ (../../lib/chromedriver.js:163:26)
at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
Error: session not created exception: Chrome version must be >= 65.0.3325.0
(Driver info: chromedriver=2.38.552518 (183d19265345f54ce39cbb94cf81ba5f15905011),platform=Mac OS X 10.13.4 x86_64)
at Chromedriver.callee$2$0$ (../../lib/chromedriver.js:163:26)
at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
[MJSONWP] Encountered internal error running command: Error: session not created exception: Chrome version must be >= 65.0.3325.0
(Driver info: chromedriver=2.38.552518 (183d19265345f54ce39cbb94cf81ba5f15905011),platform=Mac OS X 10.13.4 x86_64)
at Chromedriver.callee$2$0$ (../../lib/chromedriver.js:163:26)
at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
[HTTP] <-- POST /wd/hub/session/fa4f13cc-80b2-4db1-b417-cd13798ee4af/context 500 2885 ms - 358 

https://appium.io/docs/en/writing-running-appium/web/chromedriver/

从上述位置下载预期的 exe 版本,并在下面设置 AndroidDriver 的所需功能。

DesiredCapabilities desiredCapabilities = new DesiredCapabilities();  
desiredCapabilities.setCapability("chromedriverExecutable","D:\Automation_Project\MobileAutomationBestPractices\drivers\chromedriver.exe");

您可以让 Appium 自动下载 chromedriver 版本:

"appium --allow-不安全chromedriver_autodownload"在运行Appium服务器的CMD中运行它。一旦我们运行上面的命令,然后appium就会获得与模拟器/设备匹配的兼容浏览器版本,现在从下次开始,只需正常启动appium服务器并运行代码即可。

上述命令在 Appium v1.21.0 中测试

查看此视频 - 如何更新应用程序铬驱动程序

appium --allow-insecure chromedriver_autodownload

它对我有用。

以下是Chrome驱动程序版本及其相应的可自动执行的最低Chrome版本的列表:

https://appium.io/docs/en/writing-running-appium/web/chromedriver/

您需要将Chrome升级到最新版本,即:

Chrome 版本必须为>= 65.0.3325.0

驱动程序信息:chromedriver = 2.38.552518,如日志中所述。

如果您特别需要Chrome版本"53.0.2785",则应安装与相应版本兼容的ChromeDriver 2.26 https://chromedriver.storage.googleapis.com/index.html?path=2.26/。

参考:

https://appium.io/docs/en/writing-running-appium/web/chromedriver/

如何升级 appium 的 chromedriver 版本?

您需要根据此处的版本更新/降级 appium 的 chromedriver.exe 文件 https://appium.io/docs/en/writing-running-appium/web/chromedriver/

可在以下路径"C:Users[UserName]AppDataLocalProgramsappium-desktopresourcesappnode_modulesappiumnode_modulesappium-chromedriverchromedriverwin"

只需删除以前的chromedriver.exe然后下载并粘贴相应的版本。

运行此命令

appium --allow-insecure chromedriver_autodownload

如果您正在运行带有GUI的Appium,请按如下方式安装Appium npm软件包:

  1. 安装节点 js 如果未安装
  2. 运行以下命令:npm install -g appium
  3. 添加环境变量ANDROID_HOME(C:\Users<用户名>\AppData\Local\Android\Sdk(和JAVA_HOME
  4. 运行命令 appium --allow-不安全chromedriver_autodownload

对于Windows中的混合Android应用程序,还有一个用例,当用户具有上下文但无法切换(尤其是WebView(时: 用户可能会看到

NoSuchContextException: An unknown server-side error occurred while processing the command. 
Original error: No ChromeDriver found that can automate Chrome '116.0.0'.

然后,更新Appium和驱动程序

-> npm appium 驱动程序更新

-> appium 驱动程序更新

终止服务器并重新启动。

如果问题仍然存在,则 检查服务器日志

Found 1 executable in 'C:Usersdhakshath.appiumnode_modulesappium-flutter-drivernode_modulesappium-uiautomator2-drivernode_modulesappium-chromedriverchromedriverwin'
[debug] [Chromedriver@75e3] The following Chromedriver executables were found:
[debug] [Chromedriver@75e3]     'C:/Users/dhakshath/.appium/node_modules/appium-flutter-driver/node_modules/appium-uiautomator2-driver/node_modules/appium-chromedriver/chromedriver/win/chromedriver-win64_v115.0.5790.170.exe' (version '115.0.5790.170', minimum Chrome version '115.0.5790')

所以用户需要转到找到 1 中提到的路径>>C:Usersdhakshath.appiumnode_modulesappium-flutter-drivernode_modulesappium-uiautomator2-drivernode_modulesappium-chromedriverchromedriverwin

复制 chromedriver .exe 并将其替换为

C:/Users/dhakshath/.appium/node_modules/appium-flutter-driver/node_modules/appium-uiautomator2-driver/node_modules/appium-chromedriver/chromedriver/win/chromedriver-win64_v115.0.5790.170.exe

重新启动应用程序,它将起作用。

如果仍然版本不匹配,则用户可能需要手动下载chromedriver并将其粘贴。

最新更新