Appium+Protractor在Linux平台用multiCapabilities可行吗?配置报错求助
Short Answer
Absolutely, using multiCapabilities to run cross-platform tests (Android patient app + desktop Chrome doctor web UI) with Appium and Protractor on Linux is totally feasible. The error you’re seeing comes from a small configuration mistake, not a limitation of the setup itself.
What’s Causing the "Could not find a driver for platformName..." Error?
Looking at your config, the Chrome capability includes platformName:'linux'—this is unnecessary for desktop browser sessions. Protractor uses ChromeDriver directly for desktop Chrome tests, and adding this platform-specific parameter confuses it into searching for a driver that doesn’t exist for desktop setups.
Fixed MultiCapabilities Configuration
Here’s the corrected config with the problematic line removed:
multiCapabilities: [ { browserName: 'android', platformName: 'android', platformVersion: '6.0', deviceName: 'android', autoWebview: true, app: '/home/myPc/e2e/build/android/patient.apk', autoGrantPermissions: true, framework: 'jasmine' }, { browserName: 'chrome' // Removed platformName: 'linux' — no need for desktop Chrome tests } ]
Key Tips for Smooth Execution on Linux
- Appium Service: Make sure the Appium server is running before launching your tests. You can start it manually via
appiumin the terminal, or configure Protractor to spin it up automatically using theappiumsection in your config file. - Android Environment Check: Verify your Linux machine has the Android SDK installed,
adbis added to your system PATH, and your Android device/emulator is recognized (runadb devicesto confirm). - ChromeDriver Compatibility: For the desktop Chrome session, ensure your ChromeDriver version matches the installed Chrome browser version on your Linux machine. Protractor’s
webdriver-managercan handle this automatically, but double-check if you hit Chrome-related errors. - Resource Management: If running an Android emulator alongside desktop Chrome, make sure your Linux machine has enough RAM and CPU to handle both sessions without slowdowns or crashes.
内容的提问来源于stack exchange,提问作者Uttam Panara

