System details:
ChromeDriver 2.20.353124
Appium 1.4.16
Mac OS X Yosemite Version 10.10.5
I am trying to pass browserName but I get error as below.
desired_caps = dict()
desired_caps[‘platformName’] = ‘Android’
desired_caps[‘platformVersion’] = ‘6.0’
desired_caps[‘deviceName’] = ‘Android Emulator’
desired_caps[‘appActivity’] = ‘com.google.android.gms.app.settings.GoogleSettingsActivity’
desired_caps[‘appPackage’] = ‘com.google.android.gms’
desired_caps[‘newCommandTimeout’] = 1000
desired_caps[‘browserName’] = ‘Chrome’
self.driver = webdriver.Remote(‘http://localhost:4723/wd/hub’, desired_caps)
It works fine if I remove desired_caps['browserName'] = 'Chrome'
Sometimes after long time I get error BadStatusLine: ''
info: Welcome to Appium v1.4.16 (REV ae6877eff263066b26328d457bd285c0cc62430d)
info: Appium REST http interface listener started on 0.0.0.0:4723
info: Console LogLevel: debug
info: --> POST /wd/hub/session {"desiredCapabilities":{"deviceName":"Android Emulator","browserName":"Chrome","newCommandTimeout":1000,"platformVersion":"6.0","appPackage":"com.google.android.gms","platformName":"Android","appActivity":"com.google.android.gms.app.settings.GoogleSettingsActivity"}}
info: Client User-Agent string: Python-urllib/2.7
info: Set mode: Proxying straight through to Chromedriver
info: [debug] Looks like we want chrome on android
info: [debug] Creating new appium session 5a48aef0-8791-4ff2-a7cf-d73acae1feea
info: [debug] Checking whether adb is present
info: [debug] Using adb from /Users/adt-bundle-mac-x86_64-20140702/sdk/platform-tools/adb
info: [debug] Using fast reset? true
info: [debug] Preparing device for session
info: [debug] Not checking whether app is present since we are assuming it's already on the device
info: Retrieving device
info: [debug] Trying to find a connected android device
info: [debug] Getting connected devices...
info: [debug] executing cmd: /Users/adt-bundle-mac-x86_64-20140702/sdk/platform-tools/adb devices
info: [debug] 1 device(s) connected
info: Found device 9276da93
info: [debug] Setting device id to 9276da93
info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
info: [debug] executing cmd: /Users/adt-bundle-mac-x86_64-20140702/sdk/platform-tools/adb -s 9276da93 wait-for-device
info: [debug] executing cmd: /Users/adt-bundle-mac-x86_64-20140702/sdk/platform-tools/adb -s 9276da93 shell "echo 'ready'"
info: [debug] Starting logcat capture
info: [debug] Pushing unlock helper app to device...
info: [debug] executing cmd: /Users/adt-bundle-mac-x86_64-20140702/sdk/platform-tools/adb -s 9276da93 install "/usr/local/lib/node_modules/appium/build/unlock_apk/unlock_apk-debug.apk"
info: [debug] executing cmd: /Users/adt-bundle-mac-x86_64-20140702/sdk/platform-tools/adb -s 9276da93 shell "dumpsys window"
info: [debug] Screen already unlocked, continuing.
info: [debug] Forwarding system:4724 to device:4724
info: [debug] executing cmd: /Users/adt-bundle-mac-x86_64-20140702/sdk/platform-tools/adb -s 9276da93 forward tcp:4724 tcp:4724
info: [debug] Pushing appium bootstrap to device...
info: [debug] executing cmd: /Users/adt-bundle-mac-x86_64-20140702/sdk/platform-tools/adb -s 9276da93 push "/usr/local/lib/node_modules/appium/build/android_bootstrap/AppiumBootstrap.jar" /data/local/tmp/
info: Starting App
info: [debug] Attempting to kill all 'uiautomator' processes
info: [debug] Getting all processes with 'uiautomator'
info: [debug] executing cmd: /Users/adt-bundle-mac-x86_64-20140702/sdk/platform-tools/adb -s 9276da93 shell "ps 'uiautomator'"
info: [debug] No matching processes found
info: [debug] Running bootstrap
info: [debug] spawning: /Users/adt-bundle-mac-x86_64-20140702/sdk/platform-tools/adb -s 9276da93 shell uiautomator runtest AppiumBootstrap.jar -c io.appium.android.bootstrap.Bootstrap -e pkg com.android.chrome -e disableAndroidWatchers false
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: numtests=1
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=
info: [debug] [UIAUTOMATOR STDOUT] io.appium.android.bootstrap.Bootstrap:
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServer
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: current=1
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: 1
info: [debug] [BOOTSTRAP] [debug] Socket opened on port 4724
info: [debug] [BOOTSTRAP] [debug] Appium Socket Server Ready
info: [debug] [BOOTSTRAP] [debug] Loading json...
info: [debug] Pushing command to appium work queue: ["getDataDir",{}]
info: [debug] [BOOTSTRAP] [debug] Registered crash watchers.
info: [debug] [BOOTSTRAP] [debug] Client connected
info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"getDataDir","params":{}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: getDataDir
info: [debug] dataDir set to: /data/local/tmp
info: Chromedriver: Changed state to 'starting'
info: [debug] [BOOTSTRAP] [debug] Returning result: {"status":0,"value":"\/data\/local\/tmp"}
info: Chromedriver: Set chromedriver binary as: /usr/local/lib/node_modules/appium/node_modules/appium-chromedriver/chromedriver/mac/chromedriver
info: Chromedriver: Killing any old chromedrivers, running: ps -ef | grep /usr/local/lib/node_modules/appium/node_modules/appium-chromedriver/chromedriver/mac/chromedriver | grep -v grep |grep -e '--port=9515\(\s.*\)\?$' | awk '{ print $2 }' | xargs kill -15
info: Chromedriver: Successfully cleaned up old chromedrivers
info: Chromedriver: Spawning chromedriver with: /usr/local/lib/node_modules/appium/node_modules/appium-chromedriver/chromedriver/mac/chromedriver --url-base=wd/hub --port=9515
info: Chromedriver: [STDOUT] Starting ChromeDriver 2.20.353124 (035346203162d32c80f1dce587c8154a1efa0c3b) on port 9515
Only local connections are allowed.
info: JSONWP Proxy: Proxying [GET /status] to [GET http://127.0.0.1:9515/wd/hub/status] with no body
info: JSONWP Proxy: Got response with status 200: "{\"sessionId\":\"\",\"status\":0,\"value\":{\"build\":{\"version\":\"alpha\"},\"os\":{\"arch\":\"x86_64\",\"name\":\"Mac OS X\",\"version\":\"10.10.5\"}}}"
info: JSONWP Proxy: Proxying [POST /session] to [POST http://127.0.0.1:9515/wd/hub/session] with body: {"desiredCapabilities":{"chromeOptions":{"androidPackage":"com.android.chrome","androidDeviceSerial":"9276da93"}}}
info: JSONWP Proxy: Got response with status 200: {"sessionId":"10e70688e268822165ed79725b1d0877","status":0,"value":{"acceptSslCerts":true,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"browserName":"chrome","chrome":{},"cssSel...
info: Chromedriver: Changed state to 'online'
info: [debug] Overriding session id with "10e70688e268822165ed79725b1d0877"
info: [debug] Device launched! Ready for commands
info: [debug] Setting command timeout to 1000 secs
info: [debug] Appium session started with sessionId 10e70688e268822165ed79725b1d0877
info: <-- POST /wd/hub/session 303 9919.695 ms - 70
info: --> GET /wd/hub/session/10e70688e268822165ed79725b1d0877 {}
info: JSONWP Proxy: Proxying [GET /wd/hub/session/10e70688e268822165ed79725b1d0877] to [GET http://127.0.0.1:9515/wd/hub/session/10e70688e268822165ed79725b1d0877] with body: {}
info: JSONWP Proxy: Got response with status 200: {"sessionId":"10e70688e268822165ed79725b1d0877","status":0,"value":{"acceptSslCerts":true,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"browserName":"chrome","chrome":{},"cssSel...
info: JSONWP Proxy: Replacing sessionId 10e70688e268822165ed79725b1d0877 with 10e70688e268822165ed79725b1d0877
info: <-- GET /wd/hub/session/10e70688e268822165ed79725b1d0877 200 6.259 ms - 528
info: --> GET /wd/hub/session/10e70688e268822165ed79725b1d0877/appium/device/current_activity {}
info: JSONWP Proxy: Proxying [GET /wd/hub/session/10e70688e268822165ed79725b1d0877/appium/device/current_activity] to [GET http://127.0.0.1:9515/wd/hub/session/10e70688e268822165ed79725b1d0877/appium/device/current_activity] with body: {}
error: Could not proxy command to remote server. Original error: 404 - unknown command: session/10e70688e268822165ed79725b1d0877/appium/device/current_activity