question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Appium : Android chrome browser launched & closed automatically

See original GitHub issue

The problem

When i try to run the following script via real device, results in session not found issue . Anyone help me out to resolve the same ! DesiredCapabilities capabilities = new DesiredCapabilities(); capabilities.setCapability(“deviceName”, “000e20727b839f”); capabilities.setCapability(“newCommandTimeout”, 120); capabilities.setCapability(“browserName”, “Chrome”); capabilities.setCapability(“launchTimeout”, “100000”); capabilities.setCapability(“platformName”, “Android”); capabilities.setCapability(“platformVersion”, “6.0.1”); driver = new RemoteWebDriver(new URL(“http://10.155.104.185:4723/wd/hub”), capabilities); driver.navigate().to(“http://www.google.com”); System.out.println(“Android Device browser called successfully”);

Note: Chrome is updated to the latest Selenium webdriver : 3.0.1

Environment

  • Appium version (or git revision) that exhibits the issue: 1.4.16
  • Last Appium version that did not exhibit the issue (if applicable):
  • Desktop OS/version used to run Appium:Windows 7 64bit
  • Node.js version (unless using Appium.app|exe):
  • Mobile platform/version under test: Android 6.0.1
  • Real device or emulator/simulator: Real device ,Galaxy Note5
  • Appium CLI or Appium.app|exe:

Details

Describe in more detail the problem you have been experiencing, if necessary.

Link to Appium logs

info: Chromedriver: Changed state to ‘starting’ info: Chromedriver: Set chromedriver binary as: C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-chromedriver\chromedriver\win\chromedriver.exe info: Chromedriver: 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 %a)) info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION info: [debug] [BOOTSTRAP] [debug] Got command action: getDataDir info: [debug] [BOOTSTRAP] [debug] Returning result: {“status”:0,“value”:“/data/local/tmp”} info: Chromedriver: No old chromedrivers seemed to exist info: Chromedriver: Spawning chromedriver with: C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-chromedriver\chromedriver\win\chromedriver.exe --url-base=wd/hub --port=9515 info: Chromedriver: [STDOUT] Starting ChromeDriver 2.18.343845 (73dd713ba7fbfb73cbb514e62641d8c96a94682a) 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":"Windows NT","version":"6.1 SP1"}}}” 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”:“1115fb90a0a70304”}}} info: JSONWP Proxy: Got response with status 200: {“sessionId”:“2bfb3242510d121a1149668cc0360fb5”,“status”:13,“value”:{“message”:"unknown error: Device 1115fb90a0a70304 is not online\n (Driver info: chromedriver=2.18.343845 (73dd713ba7fbfb73cbb51… 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”:“1115fb90a0a70304”}}} info: JSONWP Proxy: Got response with status 200: {“sessionId”:“0fee9abce5d95006999f124f95cb196c”,“status”:13,“value”:{“message”:"unknown error: Device 1115fb90a0a70304 is not online\n (Driver info: chromedriver=2.18.343845 (73dd713ba7fbfb73cbb51… 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”:“1115fb90a0a70304”}}} info: JSONWP Proxy: Got response with status 200: {“sessionId”:“df91f783fefcdf2f4fe3c6ed30290426”,“status”:13,“value”:{“message”:"unknown error: Device 1115fb90a0a70304 is not online\n (Driver info: chromedriver=2.18.343845 (73dd713ba7fbfb73cbb51… 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”:“1115fb90a0a70304”}}} info: JSONWP Proxy: Got response with status 200: {“sessionId”:“47e83f716322a3bdbaee0b674e65321d”,“status”:13,“value”:{“message”:"unknown error: Device 1115fb90a0a70304 is not online\n (Driver info: chromedriver=2.18.343845 (73dd713ba7fbfb73cbb51… error: Chromedriver: Chromedriver exited unexpectedly with code null, signal SIGTERM info: Chromedriver: Changed state to ‘stopped’ info: Chromedriver stopped unexpectedly on us, shutting down then calling back up with the on-die callback error: Chromedriver: Error: An unknown server-side error occurred while processing the command. (Original error: unknown error: Device 1115fb90a0a70304 is not online (Driver info: chromedriver=2.18.343845 (73dd713ba7fbfb73cbb514e62641d8c96a94682a),platform=Windows NT 6.1 SP1 x86_64)) at JWProxy.command$ (lib/proxy.js:133:15) at tryCatch (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-chromedriver\node_modules\appium-jsonwp-proxy\node_modules\babel-runtime\regenerator\runtime.js:67:40) at GeneratorFunctionPrototype.invoke [as _invoke] (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-chromedriver\node_modules\appium-jsonwp-proxy\node_modules\babel-runtime\regenerator\runtime.js:315:22) at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-chromedriver\node_modules\appium-jsonwp-proxy\node_modules\babel-runtime\regenerator\runtime.js💯21) at GeneratorFunctionPrototype.invoke (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-chromedriver\node_modules\appium-jsonwp-proxy\node_modules\babel-runtime\regenerator\runtime.js:136:37) at bound (domain.js:284:14) at GeneratorFunctionPrototype.runBound (domain.js:297:12) at run (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-chromedriver\node_modules\appium-jsonwp-proxy\node_modules\babel-runtime\node_modules\core-js\library\modules\es6.promise.js:89:39) at C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-chromedriver\node_modules\appium-jsonwp-proxy\node_modules\babel-runtime\node_modules\core-js\library\modules\es6.promise.js💯28 at flush (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-chromedriver\node_modules\appium-jsonwp-proxy\node_modules\babel-runtime\node_modules\core-js\library\modules$.microtask.js:17:13) at process._tickDomainCallback (node.js:381:11) { [Error: An unknown server-side error occurred while processing the command. (Original error: unknown error: Device 1115fb90a0a70304 is not online (Driver info: chromedriver=2.18.343845 (73dd713ba7fbfb73cbb514e62641d8c96a94682a),platform=Windows NT 6.1 SP1 x86_64))] status: 13, value: { message: ‘unknown error: Device 1115fb90a0a70304 is not online\n (Driver info: chromedriver=2.18.343845 (73dd713ba7fbfb73cbb514e62641d8c96a94682a),platform=Windows NT 6.1 SP1 x86_64)’ }, httpCode: 200 } info: [debug] Cleaning up appium session error: Failed to start an Appium session, err was: Error: An unknown server-side error occurred while processing the command. (Original error: unknown error: Device 1115fb90a0a70304 is not online (Driver info: chromedriver=2.18.343845 (73dd713ba7fbfb73cbb514e62641d8c96a94682a),platform=Windows NT 6.1 SP1 x86_64)) info: [debug] Error: An unknown server-side error occurred while processing the command. (Original error: unknown error: Device 1115fb90a0a70304 is not online (Driver info: chromedriver=2.18.343845 (73dd713ba7fbfb73cbb514e62641d8c96a94682a),platform=Windows NT 6.1 SP1 x86_64)) at JWProxy.command$ (lib/proxy.js:133:15) at tryCatch (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-chromedriver\node_modules\appium-jsonwp-proxy\node_modules\babel-runtime\regenerator\runtime.js:67:40) at GeneratorFunctionPrototype.invoke [as _invoke] (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-chromedriver\node_modules\appium-jsonwp-proxy\node_modules\babel-runtime\regenerator\runtime.js:315:22) at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-chromedriver\node_modules\appium-jsonwp-proxy\node_modules\babel-runtime\regenerator\runtime.js💯21) at GeneratorFunctionPrototype.invoke (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-chromedriver\node_modules\appium-jsonwp-proxy\node_modules\babel-runtime\regenerator\runtime.js:136:37) at bound (domain.js:284:14) at GeneratorFunctionPrototype.runBound (domain.js:297:12) at run (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-chromedriver\node_modules\appium-jsonwp-proxy\node_modules\babel-runtime\node_modules\core-js\library\modules\es6.promise.js:89:39) at C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-chromedriver\node_modules\appium-jsonwp-proxy\node_modules\babel-runtime\node_modules\core-js\library\modules\es6.promise.js💯28 at flush (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-chromedriver\node_modules\appium-jsonwp-proxy\node_modules\babel-runtime\node_modules\core-js\library\modules$.microtask.js:17:13) at process._tickDomainCallback (node.js:381:11) info: [debug] Responding to client with error: {“status”:33,“value”:{“message”:“A new session could not be created. (Original error: An unknown server-side error occurred while processing the command. (Original error: unknown error: Device 1115fb90a0a70304 is not online\n (Driver info: chromedriver=2.18.343845 (73dd713ba7fbfb73cbb514e62641d8c96a94682a),platform=Windows NT 6.1 SP1 x86_64)))”,“status”:13,“value”:{“message”:“unknown error: Device 1115fb90a0a70304 is not online\n (Driver info: chromedriver=2.18.343845 (73dd713ba7fbfb73cbb514e62641d8c96a94682a),platform=Windows NT 6.1 SP1 x86_64)”},“httpCode”:200,“origValue”:“An unknown server-side error occurred while processing the command. (Original error: unknown error: Device 1115fb90a0a70304 is not online\n (Driver info: chromedriver=2.18.343845 (73dd713ba7fbfb73cbb514e62641d8c96a94682a),platform=Windows NT 6.1 SP1 x86_64))”},“sessionId”:null} info: <-- POST /wd/hub/session 500 5634.757 ms - 863 info: [debug] [BOOTSTRAP] [debug] Got data from client: {“cmd”:“shutdown”} info: [debug] [BOOTSTRAP] [debug] Got command of type SHUTDOWN info: [debug] [BOOTSTRAP] [debug] Returning result: {“status”:0,“value”:“OK, shutting down”} info: [debug] [BOOTSTRAP] [debug] Closed client connection info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: numtests=1 info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=. info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServer info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class= info: [debug] [UIAUTOMATOR STDOUT] io.appium.android.bootstrap.Bootstrap info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: current=1 info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: 0 info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream= info: [debug] [UIAUTOMATOR STDOUT] Test results for WatcherResultPrinter=. info: [debug] [UIAUTOMATOR STDOUT] Time: 2.068 info: [debug] [UIAUTOMATOR STDOUT] OK (1 test) info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: -1 info: [debug] Sent shutdown command, waiting for UiAutomator to stop… info: [debug] UiAutomator shut down normally info: [debug] executing cmd: “D:\Android Setup\android-sdk-installer\platform-tools\adb.exe” -s 1115fb90a0a70304 shell “am force-stop com.android.chrome” info: [debug] Stopping logcat capture info: [debug] Logcat terminated with code null, signal SIGTERM info: [debug] Cleaning up appium session

Code To Reproduce Issue [ Good To Have ]

When i try to run the following script , results in session not found issue DesiredCapabilities capabilities = new DesiredCapabilities(); capabilities.setCapability(“deviceName”, “000e20727b839f”); capabilities.setCapability(“newCommandTimeout”, 120); capabilities.setCapability(“browserName”, “Chrome”); capabilities.setCapability(“launchTimeout”, “100000”); capabilities.setCapability(“platformName”, “Android”); capabilities.setCapability(“platformVersion”, “6.0.1”); driver = new RemoteWebDriver(new URL(“http://10.155.104.185:4723/wd/hub”), capabilities); driver.navigate().to(“http://www.google.com”); System.out.println(“Android Device browser called successfully”);

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
sathishrmrcommented, Nov 8, 2016

Hi mykola-mokhnach ,

I had solved the issue, Thanks for your response and time !

Download latest chrome driver 2.25 https://chromedriver.storage.googleapis.com/index.html?path=2.25/ Provide path : capabilities.setCapability(“chromedriverExecutable”, “…path.//chromedriver.exe”);

DesiredCapabilities capabilities = new DesiredCapabilities(); capabilities.setCapability(“deviceName”, “000e20727b839f”); capabilities.setCapability(“newCommandTimeout”, 120); capabilities.setCapability(“chromedriverExecutable”, “…path.//chromedriver.exe”); capabilities.setCapability(“browserName”, “Chrome”); capabilities.setCapability(“launchTimeout”, “100000”); capabilities.setCapability(“platformName”, “Android”); capabilities.setCapability(“platformVersion”, “6.0.1”); driver = new RemoteWebDriver(new URL(“http://10.155.104.185:4723/wd/hub”), capabilities); driver.navigate().to(“http://www.google.com”); System.out.println(“Android Device browser called successfully”);

Result :
Android chrome browser launched successfully !

0reactions
lock[bot]commented, Apr 28, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Chrome browser closes right after it loads first test step (does ...
New here, facing some issues with using Chrome on Android Emulator. My automation only executes the first navigation step and closes the browser...
Read more >
Both Chrome & emulator is closing automatically when I run ...
Show activity on this post. I started mobile site automation with protractor and appium, so when I run my script, then chrome &...
Read more >
Driver is starting a browser activity but switches back to app ...
I am using AndroidDriver driver.startActivity(appPackage, appActivity) to start chrome. Lemme explain you what's happening step by step. This is ...
Read more >
Chrome crashing on clicking an element in webapplication
I have to click on chrome which opens the you-tube link on the browser and navigates to a particular page automatically. But the...
Read more >
Url is not getting entered in chrome browser - Appium Discuss
Facing issue while launching chrome browser Appium. Chrome browser is getting opened multiple times(4 times) and closing even if a single ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found