Did not get session redirect from Chromedriver

I was able to run my test successfully with 4.4.2 genymotion emulator. But when I update the device 4.4.4 then it is saying that "Did not get session redirect from Chromedriver."

Please help me.

Coping server log here.

error: Chromedriver create session did not work. Status was 200 and body was {“s
essionId”:“0c89c0fa91a37dd74d134f409c960af6”,“status”:13,“value”:{“message”:“unk
nown error: Chrome version must be >= 36.0.1985.0\n (Driver info: chromedriver=
2.11.298604 (75ea2fdb5c87f133a8e1b8da16f6091fb7d5321e),platform=Windows NT 6.1 S
P1 x86_64)”}}
info: [debug] Responding to client with error: {“status”:13,“value”:{“message”:"
An unknown server-side error occurred while processing the command. (Original er
ror: Did not get session redirect from Chromedriver)",“origValue”:“Did not get s
ession redirect from Chromedriver”},“sessionId”:“4655525f-f82d-47e7-ada7-f2dfdf0
f5153”}
info: <-- POST /wd/hub/session/4655525f-f82d-47e7-ada7-f2dfdf0f5153/context 500
3986.558 ms - 280

Server Log.

info: [debug] [“WEBVIEW_com.google.android.apps.magazines”,“WEBVIEW_com.app.mobileapp”]

info: [debug] Available contexts: NATIVE_APP,WEBVIEW_com.google.android.apps.magazines,WEBVIEW_com.app.mobileapp
info: [debug] Connecting to chrome-backed webview
info: [debug] Creating Chrome session
info: [debug] Set chromedriver binary as: E:\Appium\Appium\node_modules\appium\build\chromedriver\windows\chromedriver.exe
info: [debug] Ensuring Chromedriver exists
info: [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))
info: [debug] No old chromedrivers seemed to exist
info: [debug] Spawning chromedriver with: E:\Appium\Appium\node_modules\appium\build\chromedriver\windows\chromedriver.exe
info: [debug] [CHROMEDRIVER] Starting ChromeDriver (v2.10.267521) on port 9515
Only local connections are allowed.
info: [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.app.mobileapp”,“androidUseRunningApp”:true,“androidDeviceSerial”:"192.168.246.101:5555”}}}}
info: [debug] [CHROMEDRIVER STDERR] [0.006][SEVERE]: Could not bind socket to 127.0.0.1:9515
info: [debug] [CHROMEDRIVER] Port not available. Exiting…
info: [debug] Chromedriver exited with code 1
info: [debug] Chromedriver exited unexpectedly
error: Chromedriver create session did not work. Status was 200 and body was {“sessionId”:“dfd801096f08ee830566b79db2af505e”,“status”:13,“value”:{“message”:“unknown error: Chrome version must be >= 33.0.1750.0\n (Driver info: chromedriver=2.10.267521,platform=Windows NT 6.1 SP1 x86_64)”}}
info: [debug] Responding to client with error: {“status”:13,“value”:{“message”:“An unknown server-side error occurred while processing the command. (Original error: Did not get session redirect from Chromedriver)”,“origValue”:“Did not get session redirect from Chromedriver”},“sessionId”:“8ca18f6a-a51b-4dd5-a0eb-0ebf125c0e76”}
info: e[37m<-- POST /wd/hub/session/8ca18f6a-a51b-4dd5-a0eb-0ebf125c0e76/context e[39me[31m500e[39me[90m 3178.852 ms - 280e[39m e[90me[39m
info: [debug] Didn’t get a new command in 60 secs, shutting down…
info: Shutting down appium session
info: [debug] Pressing the HOME button
info: [debug] executing: “E:\AutomationMob\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe” -s 192.168.246.101:5555 shell “input keyevent 3”
info: [debug] Stopping logcat capture
info: [debug] Logcat terminated with code null, signal SIGTERM

I have found the same problem recently. It is the bug of chrome driver:
https://code.google.com/p/chromedriver/issues/detail?id=803
https://code.google.com/p/chromedriver/issues/detail?id=845

Here is how I could solve it locally:

  • 1 in folder which contains chromedriver
    e.g. C:\Users\xxx\AppData\Roaming\npm\node_modules\appium\build\chromedriver\windows
    replace current binary file
    e.g. chromedriver.exe
    to actual.

  • 2 if you have replaced binary but still face this problem

e.g. now I am using Android Chrome 38.x. Appium is throwing chromedriver fails with " Chrome version must be >= 36.0.1985.0"

you can try to find chromedriver_dev and repeat 1.
Chromedriver_dev

Latest server log.

info: [debug] Available contexts: NATIVE_APP,WEBVIEW_com.myapp.mobileapp
info: [debug] Responding to client with success: {“status”:0,“value”:[“NATIVE_APP”,“WEBVIEW_com.myapp.mobileapp”],“sessionId”:“d2989318-c745-4cbd-872b-fa09d3b237f7”}
info: e[37m<-- GET /wd/hub/session/d2989318-c745-4cbd-872b-fa09d3b237f7/contexts e[39me[32m200e[39me[90m 1168.975 ms - 116e[39m e[90m{“status”:0,“value”:[“NATIVE_APP”,“WEBVIEW_com.myapp.mobileapp”],“sessionId”:“d2989318-c745-4cbd-872b-fa09d3b237f7”}e[39m
info: e[37m–>e[39m e[37mPOSTe[39m e[37m/wd/hub/session/d2989318-c745-4cbd-872b-fa09d3b237f7/contexte[39m e[90m{“name”:“WEBVIEW_com.myapp.mobileapp”}e[39m
info: [debug] Getting a list of available webviews
info: [debug] executing: “E:\AutomationMob\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe” -s 192.168.246.101:5555 shell “cat /proc/net/unix”
info: [debug] WEBVIEW_6581 mapped to pid 6581
info: [debug] Getting process name for webview
info: [debug] executing: “E:\AutomationMob\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe” -s 192.168.246.101:5555 shell “ps”
info: [debug] Parsed pid: 6581 pkg: com.myapp.mobileapp
info: [debug] from: u0_a59,6581,159,691376,93592,ffffffff,b771a07b,S,com.myapp.mobileapp
info: [debug] returning process name: com.myapp.mobileapp
info: [debug] Available contexts: NATIVE_APP,WEBVIEW_com.myapp.mobileapp
info: [debug] [“WEBVIEW_com.myapp.mobileapp”]
info: [debug] Available contexts: NATIVE_APP,WEBVIEW_com.myapp.mobileapp
info: [debug] Connecting to chrome-backed webview
info: [debug] Creating Chrome session
info: [debug] Set chromedriver binary as: E:\Appium\Appium\node_modules\appium\build\chromedriver\windows\chromedriver.exe
info: [debug] Ensuring Chromedriver exists
info: [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))
info: [debug] No old chromedrivers seemed to exist
info: [debug] Spawning chromedriver with: E:\Appium\Appium\node_modules\appium\build\chromedriver\windows\chromedriver.exe
info: [debug] [CHROMEDRIVER] Starting ChromeDriver (v2.10.267521) on port 9515
Only local connections are allowed.
info: [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.myapp.mobileapp”,“androidUseRunningApp”:true,“androidDeviceSerial”:"192.168.246.101:5555”}}}}
error: Chromedriver create session did not work. Status was 200 and body was {“sessionId”:“d900d2d6c4dc2f37ca75cf8df814bc0c”,“status”:13,“value”:{“message”:“unknown error: Chrome version must be >= 33.0.1750.0\n (Driver info: chromedriver=2.10.267521,platform=Windows NT 6.1 SP1 x86_64)”}}
info: [debug] Responding to client with error: {“status”:13,“value”:{“message”:“An unknown server-side error occurred while processing the command. (Original error: Did not get session redirect from Chromedriver)”,“origValue”:“Did not get session redirect from Chromedriver”},“sessionId”:“d2989318-c745-4cbd-872b-fa09d3b237f7”}
info: e[37m<-- POST /wd/hub/session/d2989318-c745-4cbd-872b-fa09d3b237f7/context e[39me[31m500e[39me[90m 3529.822 ms - 280e[39m e[90me[39m
info: e[37m–>e[39m e[37mPOSTe[39m e[37m/wd/hub/session/d2989318-c745-4cbd-872b-fa09d3b237f7/elemente[39m e[90m{“using”:“id”,“value”:“settings”}e[39m
info: [debug] Proxying command to 127.0.0.1:9515
info: [debug] Making http request with opts: {“url”:“http://127.0.0.1:9515/wd/hub/session/d2989318-c745-4cbd-872b-fa09d3b237f7/element",“method”:“POST”,“json”:{“using”:“id”,“value”:"settings”}}
info: [debug] Responding to client with error: {“status”:6,“value”:{“message”:“A session is either terminated or not started”,“origValue”:“no such session\n (Driver info: chromedriver=2.10.267521,platform=Windows NT 6.1 SP1 x86_64)”},“sessionId”:“d2989318-c745-4cbd-872b-fa09d3b237f7”}
info: e[37m<-- POST /wd/hub/session/d2989318-c745-4cbd-872b-fa09d3b237f7/element e[39me[31m500e[39me[90m 5.934 ms - 239e[39m e[90me[39m

@ramshankar_testing have you read my message above? :slight_smile:
What is you chrome version? :slight_smile:

The root cause is in chromedriver. Actual is 2.11: http://chromedriver.storage.googleapis.com/index.html

If 2.11 doesn’t work out this problem you can try with chromedriver_dev (link is in my message above)

Thanks a ton for your reply…

I dont find the path C:\Users\xxx\AppData\Roaming\npm\node_modules\appium\build\chromedriver\windows.

I fount upto C:\Users\xxx\AppData\Roaming\npm

Is there any other place I will find this ?

Thanks,
Ramshankar.

it was an example (here my node is located) :smile: )
I am looking at your logs and seeing it: E:\Appium\Appium\node_modules\appium\build\chromedriver\windows\

Don’t forget to rename chromedriver_dev.exe to chromedriver.exe

Thanks SergeyTichomirov for supporting me. It started working on emulator. But when I try in real device it does not show the webview at all on android 4.4.2 device.

Any idea on same ?

Thanks,
Ramshankar.

I have not tried it with real device :frowning: (only emulator and Genymotion VM). There all is fine. Do somemebody know how to help @ramshankar_testing?

I’m also facing the same issue. I can able to access the web views while using android emulator but when I’m trying to replicate the same in real device getting an error “Did not get session redirect from Chromedriver”.

I have followed the work around mentioned above. I deleted the old chromedriver and pasted the latest chrome driver into that location (/usr/local/lib/node_modules/appium/build/chromedriver/mac/chromedriver), but again getting the same. I have tried all the chromedriver versions 2.9,2.10,2.11.

I have tried in
-Android v4.4.2
-MOTO G device
-Appium version 1.3

This is my server log:

info: [debug] Available contexts: NATIVE_APP,WEBVIEW_com.sample.test
info: [debug] [“WEBVIEW_com.sample.test”]
info: [debug] Available contexts: NATIVE_APP,WEBVIEW_com.sample.test
info: [debug] Connecting to chrome-backed webview
info: [debug] Creating Chrome session
info: [debug] Set chromedriver binary as: /usr/local/lib/node_modules/appium/build/chromedriver/mac/chromedriver
info: [debug] Ensuring Chromedriver exists
info:
[debug] Killing any old chromedrivers, running: ps -ef | grep
/usr/local/lib/node_modules/appium/build/chromedriver/mac/chromedriver |
grep -v grep |grep -e ‘–port=9515$’ | awk ‘{ print $2 }’ | xargs kill
-15
info: [debug] Successfully cleaned up old chromedrivers
info: [debug] Spawning chromedriver with: /usr/local/lib/node_modules/appium/build/chromedriver/mac/chromedriver
info: [debug] [CHROMEDRIVER] Starting ChromeDriver (v2.10.267517) on port 9515
Only local connections are allowed.
info:
[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.sample.test”,“androidUseRunningApp”:true,"androidDeviceSerial”:”*******”}}}}
info: [debug] [CHROMEDRIVER STDERR] [0.036][SEVERE]: Could not bind socket to 127.0.0.1:9515
info: [debug] [CHROMEDRIVER] Port not available. Exiting…
info: [debug] Chromedriver exited with code 1
info: [debug] Chromedriver exited unexpectedly
error: Chromedriver create session did not work. Status was 200 and body was {“sessionId”:“7d383c002b8b29a718cb4225a77d3ac4”,“status”:13,“value”:{“message”:“unknown error: Chrome version must be >= 33.0.1750.0\n (Driver info: chromedriver=2.10.267517,platform=Mac OS X 10.9.5 x86_64)”}}
info: [debug] Responding to client with error:{“status”:13,“value”:{“message”:“An unknown server-side error occurred while processing the command. (Original error: Did not get session redirect from Chromedriver)”,“origValue”:“Did not get session redirect from Chromedriver”},“sessionId”:“d798f870-bce5-466d-99c8-15bda4390b10”}

Any help is highly appreciated!!

@PRABU90
Do you get webview on real device ?

@ramshankar_testing,

I was able to launch chrome browser on my Galaxy S5 [4.4.2] with the whatever chromedriver that was there as part of Appium1.2.4.1. And also I can see that there are 2 contexts in Viz. “NATIVE_APP” and “WEBVIEW_1”.

And I am able switch from webview to native_app and continue wit my scenario.

Let me know if you are lookig for some specific inofrmation?

Thanks,
Raghavendra

Thanks for immediate reply. I’m getting two views NATIVE_APP and WEBVIEW_com.sample.test. Both emulator and real devices getting these two views. But I’m getting error only in real devices.

This is my sample code:

       Set<String> contextNames = driver.getContextHandles();
        for (String contextName : contextNames) {
            System.out.println(contextName);
            if (contextName.contains("WEBVIEW")){
                 driver.context(contextName);
                 Thread.sleep(10000);
            }
        }        
       String Text1 = driver.findElement(By.cssSelector(".module_operation_title")).getText();
       System.out.println(Text1);
       Thread.sleep(10000);
        driver.findElement(By.cssSelector(".form_details")).click();
       Thread.sleep(5000);

Is there any other work around or method?? Thanks in advance.

Hi @SergeyTichomirov, Is there any “Chromedriver_dev” executable file for mac OS ?? to skip this issue.

I have tried to find the binary for Mac… But I could not find this. There are only only old versions available (from 2013).

https://code.google.com/p/chromedriver/issues/detail?id=845:

I already did most of the work, you are welcome to use my binary.
However I only did the build for windows.

https://dl.dropboxusercontent.com/u/2350370/chromedriver_dev.exe

:frowning:

Have you tried 2.12? Is result the same?

No. I have tested in chrome driver v2.9, v2.10,and v2.11 versions.

Actually I suggested chromedriver_dev because a week ago there was only 2.11. Today I have found that 2.12 is released.

@raghuappium I am using MOTO G and Samsung Note 3 with android version 4.4.2 / 4.4.4 but I am not able to see the webview on the real device. On the otherhand same emulator works for me with same android version.