我看一些老司机,说用 grid ,
问题一。grid 可以实现多台手机不同任务运行么?
问题二。有木有 grid 的好点的教程,我在慕课买了 selenium 的课程也没看到说 grid,有木有老司机走过这条路,给小弟指个方向。
问题三。grid 也是 启动多个 appium server 么? 和我用批处理文件 启动多个 server 有什么区别么?
我用 testNG 的数据驱动实现了
node /Applications/Appium.app/Contents/Resources/node_modules/appium/build/lib/main.js --no-reset -p "4923" -bp "4933"
启动指定不同端口的 server 来分发测试
String command = "appium --session-override -p "+port+" --chromedriver-port "+chromePort+" -bp "+bootstrapPort;
我用代码启动,appium 的 server, 但是到最后
this.driver = new AndroidDriver(new URL("http://127.0.0.1:+port+/wd/hub),capabilities");
的时候,没反应,不知道是因为 capabilities 有问题还是什么问题, 也不报错 就停在那,
@jizhirenzhong URL("http://127.0.0.1:+port+/wd/hub,capabilities")); 这个地方对吗?
恩恩对,一直卡在这里,我把日志写到文件里面了,是下面的! 困惑两天一夜了,没找到原因
2017-09-25 14:18:58:860 - info: [Appium] Welcome to Appium v1.7.0
2017-09-25 14:18:58:862 - info: [Appium] Non-default server args:
2017-09-25 14:18:58:862 - info: [Appium] port: 53722
2017-09-25 14:18:58:863 - info: [Appium] bootstrapPort: 53724
2017-09-25 14:18:58:863 - info: [Appium] sessionOverride: true
2017-09-25 14:18:58:863 - info: [Appium] log: D:\/appium.log
2017-09-25 14:18:58:863 - info: [Appium] chromeDriverPort: 53723
2017-09-25 14:18:58:930 - info: [Appium] Appium REST http interface listener started on 0.0.0.0:53722
2017-09-25 14:18:59:876 - info: [HTTP] --> POST /wd/hub/session {"capabilities":{"desiredCapabilities":{"app":"C:\Users\Administrator\Desktop\AppiumTest\src\example\AndroidCalculator.apk","browserName":"android","unicodeKeyboard":true,"platformName":"Android","udid":"127.0.0.1:62001","version":"4.4.2","deviceName":"samsung oppoR11","platform":"ANDROID","resetKeyboard":false},"requiredCapabilities":{}},"desiredCapabilities":{"app":"C:\Users\Administrator\Desktop\AppiumTest\src\example\AndroidCalculator.apk","browserName":"android","unicodeKeyboard":true,"platformName":"Android","udid":"127.0.0.1:62001","version":"4.4.2","deviceName":"samsung oppoR11","platform":"ANDROID","resetKeyboard":false},"requiredCapabilities":{}}
2017-09-25 14:18:59:879 - info: [debug] [MJSONWP] Calling AppiumDriver.createSession() with args: [{"app":"C:\Users\Administrator\Desktop\AppiumTest\src\example\AndroidCalculator.apk","browserName":"android","unicodeKeyboard":true,"platformName":"Android","udid":"127.0.0.1:62001","version":"4.4.2","deviceName":"samsung oppoR11","platform":"ANDROID","resetKeyboard":false},{},{"desiredCapabilities":{"app":"C:\Users\Administrator\Desktop\AppiumTest\src\example\AndroidCalculator.apk","browserName":"android","unicodeKeyboard":true,"platformName":"Android","udid":"127.0.0.1:62001","version":"4.4.2","deviceName":"samsung oppoR11","platform":"ANDROID","resetKeyboard":false},"requiredCapabilities":{}}]
2017-09-25 14:18:59:880 - info: [debug] [BaseDriver] Event 'newSessionRequested' logged at 1506349139880 (22:18:59 GMT+0800 (中国标准时间))
2017-09-25 14:18:59:882 - info: [Appium] Creating new AndroidDriver (v1.26.5) session
2017-09-25 14:18:59:882 - info: [Appium] Capabilities:
2017-09-25 14:18:59:884 - info: [Appium] app: 'C:\Users\Administrator\Desktop\AppiumTest\src\example\AndroidCalculator.apk'
2017-09-25 14:18:59:884 - info: [Appium] browserName: 'android'
2017-09-25 14:18:59:885 - info: [Appium] unicodeKeyboard: true
2017-09-25 14:18:59:885 - info: [Appium] platformName: 'Android'
2017-09-25 14:18:59:885 - info: [Appium] udid: '127.0.0.1:62001'
2017-09-25 14:18:59:885 - info: [Appium] version: '4.4.2'
2017-09-25 14:18:59:885 - info: [Appium] deviceName: 'samsung oppoR11'
2017-09-25 14:18:59:885 - info: [Appium] platform: 'ANDROID'
2017-09-25 14:18:59:886 - info: [Appium] resetKeyboard: false
2017-09-25 14:18:59:896 - warn: [BaseDriver] The following capabilities were provided, but are not recognized by appium: version, platform.
2017-09-25 14:18:59:896 - warn: [AndroidDriver] The desired capabilities should generally not include both an app and a browserName
2017-09-25 14:18:59:930 - info: [BaseDriver] Session created with session id: e2532871-4ced-431c-9fef-483700b0bb47
2017-09-25 14:18:59:931 - info: [debug] [AndroidDriver] Getting Java version
2017-09-25 14:19:00:065 - info: [AndroidDriver] Java version is: 1.8.0_131
2017-09-25 14:19:00:068 - info: [ADB] Checking whether adb is present
2017-09-25 14:19:00:072 - info: [ADB] Using adb.exe from C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe
2017-09-25 14:19:00:073 - info: [AndroidDriver] Retrieving device list
2017-09-25 14:19:00:073 - info: [debug] [ADB] Trying to find a connected android device
2017-09-25 14:19:00:074 - info: [debug] [ADB] Getting connected devices...
2017-09-25 14:19:00:110 - info: [debug] [ADB] 1 device(s) connected
2017-09-25 14:19:00:110 - info: [AndroidDriver] Using device: 127.0.0.1:62001
2017-09-25 14:19:00:111 - info: [ADB] Checking whether adb is present
2017-09-25 14:19:00:114 - info: [ADB] Using adb.exe from C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe
2017-09-25 14:19:00:115 - info: [debug] [ADB] Setting device id to 127.0.0.1:62001
2017-09-25 14:19:00:115 - info: [BaseDriver] Using local app 'C:\Users\Administrator\Desktop\AppiumTest\src\example\AndroidCalculator.apk'
2017-09-25 14:19:00:116 - info: [debug] [AndroidDriver] Checking whether app is actually present
2017-09-25 14:19:00:117 - info: [AndroidDriver] Starting Android session
2017-09-25 14:19:00:120 - info: [debug] [ADB] Running 'C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","127.0.0.1:62001","wait-for-device"]
2017-09-25 14:19:00:158 - info: [debug] [ADB] Getting connected devices...
2017-09-25 14:19:00:193 - info: [debug] [ADB] 1 device(s) connected
2017-09-25 14:19:00:193 - info: [debug] [ADB] Running 'C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","127.0.0.1:62001","shell","echo","ping"]
2017-09-25 14:19:00:235 - info: [debug] [Logcat] Starting logcat capture
2017-09-25 14:19:00:272 - info: [debug] [AndroidDriver] Enabling Unicode keyboard support
2017-09-25 14:19:00:272 - info: [debug] [AndroidDriver] Pushing unicode ime to device...
2017-09-25 14:19:00:273 - info: [debug] [ADB] Running 'C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","127.0.0.1:62001","install","C:\Users\Administrator\AppData\Roaming\npm\node_modules\appium\node_modules\appium-android-ime\bin\UnicodeIME-debug.apk"]
2017-09-25 14:19:00:916 - info: [debug] [ADB] Getting connected devices...
2017-09-25 14:19:00:952 - info: [debug] [ADB] 1 device(s) connected
@jizhirenzhong "udid":"127.0.0.1:62001" 这个不对
表示楼主你提的问题,跟回复的内容不一致,你的问题,是通过 appium 可以多台手机运行不同的用例,而回答者是说 appium 可以多台手机通过 appium server 来运行多台手机,但用例是一样的。不知道是我不看错了~