Appium for Mobile Test on Android ( running chrome on android emulator)

1,078 views
Skip to first unread message

shankar garg

unread,
Jul 17, 2014, 5:14:08 AM7/17/14
to appium-...@googlegroups.com
Hi All,

I wanted to test mobile website using appium.  I am referring Appium documentation:

The document says: 1. i need an emulator with "com.android.chrome" package running on emulator.
The page says that we can copy the chrome app from a real device but when i do that then chrome crashes. 

Question 1) is it possible to install chrome app on an emulator? if yes please provide the steps to install chrome app on emulator.

2. Then it says we need to run appium with following capabilities:

DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities
.setCapability("platformName", "Android");
capabilities
.setCapability("platformVersion", "4.4");
capabilities
.setCapability("deviceName", "Android Emulator");
capabilities
.setCapability("browserName", "Chrome");

Question 2) : But what values of app path and package name and activity should i mention in Appium app UI. is the chrome app details or will it be blank? if i leave these fields blank then Appium server is not starting.

Question 3) if i am using real device then i believe my question 1 for chorme app will be solved on it own. but still question 2 for details on Appium UI is still valid.


Thanks,

Shankar Garg



Ka Lee Gary Wong

unread,
Jul 17, 2014, 9:49:49 AM7/17/14
to appium-...@googlegroups.com
HI

1  You will need to grab the apk not via your real device. maybe try some site like ap*leecher.com
so app ="path the apk"

2 instead of browser point to the apk and it should auto start
so in your caps add in so app ="path the apk" or something like that

3)  I think the above should fix this.

nitin gupta

unread,
Jul 18, 2014, 1:27:02 AM7/18/14
to appium-...@googlegroups.com
chrome gets opened but it does not redirect to an url....

i ma using chrome apk18 and chromedriver version 2.3



> Starting Node Server
> info: Welcome to Appium v1.2.0 (REV e53f49c706a25242e66d36685c268b599cc18da5)
> ERROR: debug: Non-default server args: {"address":"127.0.0.1","logNoColors":true,"platformName":"Android","platformVersion":"19","automationName":"Appium"}
> info: Appium REST http interface listener started on 127.0.0.1:4723
> info: LogLevel: debug
> info: --> POST /wd/hub/session {"desiredCapabilities":{"platform":"Android","javascriptEnabled":true,"acceptSslCerts":true,"deviceName":"Android Emulator","platformName":"Android","browserName":"Chrome","device":"appium","hasTouchScreen":true,"version":"4.4"}}
> ERROR: debug: Appium request initiated at /wd/hub/session
> ERROR: debug: Request received with params: {"desiredCapabilities":{"platform":"Android","javascriptEnabled":true,"acceptSslCerts":true,"deviceName":"Android Emulator","platformName":"Android","browserName":"Chrome","device":"appium","hasTouchScreen":true,"version":"4.4"}}
> ERROR: debug: The following desired capabilities were provided, but not recognized by appium. They will be passed on to any other services running on this server. : platform, javascriptEnabled, acceptSslCerts, device, hasTouchScreen, version
> ERROR: debug: Looks like we want chrome on android
> ERROR: debug: Creating new appium session dbd6b0cd-a256-4b50-85f0-081aadc05df9
> ERROR: debug: Preparing device for session
> ERROR: debug: Not checking whether app is present since we are assuming it's already on the device
> ERROR: debug: Checking whether adb is present
> ERROR: debug: Using adb from G:\adt-bundle-windows-x86-20140624\adt-bundle-windows-x86-20140624\sdk\platform-tools\adb.exe
> ERROR: 
> info: Retrieving device
> ERROR: debug: Trying to find a connected android device
> ERROR: debug: Getting connected devices...
> ERROR: debug: executing: "G:\adt-bundle-windows-x86-20140624\adt-bundle-windows-x86-20140624\sdk\platform-tools\adb.exe" devices
> ERROR: debug: 1 device(s) connected
> info: Found device emulator-5554
> ERROR: debug: Setting device id to emulator-5554
> ERROR: debug: Waiting for device to be ready and to respond to shell commands (timeout = 5)
> ERROR: debug: executing: "G:\adt-bundle-windows-x86-20140624\adt-bundle-windows-x86-20140624\sdk\platform-tools\adb.exe" -s emulator-5554 wait-for-device
> ERROR: debug: executing: "G:\adt-bundle-windows-x86-20140624\adt-bundle-windows-x86-20140624\sdk\platform-tools\adb.exe" -s emulator-5554 shell "echo 'ready'"
> ERROR: debug: Starting logcat capture
> ERROR: debug: Pushing unlock helper app to device...
> ERROR: debug: executing: "G:\adt-bundle-windows-x86-20140624\adt-bundle-windows-x86-20140624\sdk\platform-tools\adb.exe" -s emulator-5554 install "C:\Users\Tksoftware\Desktop\AppiumForWindows-1.2.0.0\Appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk"
> ERROR: debug: executing: "G:\adt-bundle-windows-x86-20140624\adt-bundle-windows-x86-20140624\sdk\platform-tools\adb.exe" -s emulator-5554 shell "dumpsys window"
> ERROR: debug: Writing dumpsys output to C:\Users\Tksoftware\Desktop\AppiumForWindows-1.2.0.0\Appium\node_modules\appium\.dumpsys.log
> ERROR: debug: Screen already unlocked, continuing.
> ERROR: debug: Creating Chrome session
> ERROR: debug: Ensuring Chromedriver exists
> ERROR: debug: Killing any old chromedrivers, running: FOR /F "usebackq tokens=5" %a in (`netstat -nao ^| findstr /R /C:"9515 "`) do (FOR /F "usebackq" %b in (`TASKLIST /FI "PID eq %a" ^| findstr /I chromedriver.exe`) do (IF NOT %b=="" TASKKILL /F /PID %b))
> ERROR: debug: No old chromedrivers seemed to exist
> ERROR: debug: Spawning chromedriver with: C:\Users\Tksoftware\Desktop\AppiumForWindows-1.2.0.0\Appium\node_modules\appium\build\chromedriver\windows\chromedriver.exe
> ERROR: debug: [CHROMEDRIVER] Starting ChromeDriver (v2.9.248315) on port 9515
> ERROR: debug: Making http request with opts: {"url":"http://127.0.0.1:9515/wd/hub/session","method":"POST","json":{"sessionId":null,"desiredCapabilities":{"chromeOptions":{"androidPackage":"com.android.chrome","androidDeviceSerial":"emulator-5554"}}}}
> ERROR: error: Chromedriver create session did not work. Status was 200 and body was {"sessionId":"478671039defa6caf54934dbfe28a430","status":100,"value":{"message":"chrome not reachable\n  (Driver info: chromedriver=2.9.248315,platform=Windows NT 6.1 SP1 x86)"}}
> info: <-- POST /wd/hub/session 500 98933.479 ms - 214 
> ERROR: debug: Cleaning up appium session
> ERROR: error: Failed to start an Appium session, err was: Error: Did not get session redirect from Chromedriver
> ERROR: debug: Error: Did not get session redirect from Chromedriver
> ERROR:     at null.<anonymous> (C:\Users\Tksoftware\Desktop\AppiumForWindows-1.2.0.0\Appium\node_modules\appium\lib\devices\android\chromedriver.js:203:12)
> ERROR:     at Request._callback (C:\Users\Tksoftware\Desktop\AppiumForWindows-1.2.0.0\Appium\node_modules\appium\lib\devices\common.js:102:5)
> ERROR:     at Request.self.callback (C:\Users\Tksoftware\Desktop\AppiumForWindows-1.2.0.0\Appium\node_modules\appium\node_modules\request\request.js:121:22)
> ERROR:     at Request.EventEmitter.emit (events.js:98:17)
> ERROR:     at Request.<anonymous> (C:\Users\Tksoftware\Desktop\AppiumForWindows-1.2.0.0\Appium\node_modules\appium\node_modules\request\request.js:985:14)
> ERROR:     at Request.EventEmitter.emit (events.js:117:20)
> ERROR:     at IncomingMessage.<anonymous> (C:\Users\Tksoftware\Desktop\AppiumForWindows-1.2.0.0\Appium\node_modules\appium\node_modules\request\request.js:936:12)
> ERROR:     at IncomingMessage.EventEmitter.emit (events.js:117:20)
> ERROR:     at _stream_readable.js:920:16
> ERROR:     at process._tickDomainCallback (node.js:459:13)
> ERROR: debug: Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: Did not get session redirect from Chromedriver)","origValue":"Did not get session redirect from Chromedriver"},"sessionId":null}
> ERROR: debug: Logcat terminated with code 0, signal null

shankar garg

unread,
Jul 18, 2014, 3:40:53 AM7/18/14
to appium-...@googlegroups.com
I am trying to use apkLeecher but still cant get the chrome apk.
Could anyone of you please share the chomre apk. 

Isaac Murchie

unread,
Jul 18, 2014, 2:28:26 PM7/18/14
to shankar garg, appium-...@googlegroups.com
I've put some Chromes here (https://github.com/imurchie/chromes) that I've had luck with on emulators. Your mileage may vary.


--
http://appium.io
---
You received this message because you are subscribed to the Google Groups "Appium-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to appium-discus...@googlegroups.com.
Visit this group at http://groups.google.com/group/appium-discuss.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages