Wrt Grid: It is impossible to create a new session because 'createSession' which takes HttpClient, InputStream and long was not found or it is not accessible (Selenium Server 3.14,Java Client 6.1.0)

I’m having the same issue on an iOS device and am very interested to hear a solution for this.

The 1st issue you could not establish a new connection was resolved, right? Your attached capabilities had no issue like you faced before. And you could send a command find_element to the target.

at io.appium.java_client.pagefactory.AppiumElementLocator$WaitingFunction.apply(AppiumElementLocator.java:192)
at io.appium.java_client.pagefactory.AppiumElementLocator$WaitingFunction.apply(AppiumElementLocator.java:1)
at org.openqa.selenium.support.ui.FluentWait.until(FluentWait.java:249)
at io.appium.java_client.pagefactory.AppiumElementLocator.waitFor(AppiumElementLocator.java:99)
at io.appium.java_client.pagefactory.AppiumElementLocator.findElement(AppiumElementLocator.java:119)

I would like to know that request send to server. Could you attach full server log via Gist or something? (I think you cannot attach all of them in here.)

[quote=“KazuCocoa, post:22, topic:24669”]
I would like to know that request send to server. Could you attach full server log via Gist or something?
@KazuCocoa I am going through blogs to understand capture of server logs…
In eclipse workspace I do see logs in console logs and same can be found in workspace.
Found belwo link need to implement capture of server logs or is there any other way? where I can get the logs present? for your sharing


As far the changes made in request in

  1. In testng.xml I had added the deviceName parameter same I passed into @Parameters
  2. Yesterday I was reading to invoke web on device for that i made change in chromedriver which I think has nothing to do but was getting some error in logs had added org.slf4j

Apart from that I made no changes…

Sorry, I’m not sure running via Eclipse case…

In my case:
terminal1: Launch a grid server
terminal2: Launch an appium server (and communicate with the grid)
terminal3 or other place: Run Java test case

Then, outputs in terminal 1, 2 and 3 will be logs for each products.
If you can also follow this way, it’s the easiest way, I think

@KazuCocoa what is terminal in ur case?

that is just a bach environment. (On macOS, “terminal” is build-in app name.)

@cyoung2727 can you please share logs if captured with @KazuCocoa as I am still struggling for same.
That will be helpful for @KazuCocoa to analyse this issue.

Hi @vsharma, you bet. I’ll get that set up and see what I can get. It’s going to be after next week though, as I’ll be unavailable over next week. So, don’t lose patience. I’ll be back!

I’ve been working on this problem for a few months now, and unfortunately, haven’t been able to fix it, even with running those latest commits from the java-client project. It started after having to upgrade our devices, so I believed there to be some compatibility issue between dependencies (as has been stated before).

But, I also started looking at this locally, and when I tried to start a hub and a node, I get an error around the hub config not being able to be read… as if it’s not parsing the config json correctly… that’s the next avenue I’m going to explore. In the meantime…

One config that worked for me was to downgrade appium server to 1.8.2-beta (with java bindings at 4.1.2, and selenium versions 3.0.1). This config doens’t really allow more than one device to run successfully, but it’s something and not nothing (as is the case with these newer versions).

Np @cyoung2727 Have good time… I will try and share if I can.

Hi @KazuCocoa logs are as below
I am still not able to get the case when the data was displayed in way as value:parameter as initial case… not sure what had caused the same.
selenium-server-standalone-3.141.59.jar
Client 6.1.0

Please let me know what combination I should try to run… (I have changed the name of apk to abcd and other data)

18:19:00.792 INFO [GridLauncherV3.parse] - Selenium server version: 3.141.59, revision: e82be7d358
18:19:00.995 INFO [GridLauncherV3.lambda$buildLaunchers$5] - Launching Selenium Grid hub on port 4444
2019-01-01 18:19:01.448:INFO::main: Logging initialized @1124ms to org.seleniumhq.jetty9.util.log.StdErrLog
18:19:01.994 INFO [Hub.start] - Selenium Grid hub is up and running
18:19:01.994 INFO [Hub.start] - Nodes should register to http://192.168.1.102:4444/grid/register/
18:19:01.994 INFO [Hub.start] - Clients should connect to http://192.168.1.102:4444/wd/hub
18:20:45.136 INFO [DefaultGridRegistry.add] - Registered a node http://127.0.0.1:5000
18:20:59.582 INFO [DefaultGridRegistry.add] - Registered a node http://127.0.0.1:5001
2019-01-01 18:21:50.059:WARN:osjs.HttpChannel:qtp510464020-16: /wd/hub/session java.io.IOException: org.openqa.grid.common.exception.GridException: Cannot extract a capabilities from the request: {
“desiredCapabilities”: {
“app”: “C:\Users\vaibhav.sharma\Latest WorkSpace\IDIAutomation\src\main\abcd.apk”,
“appActivity”: “abcd”,
“appPackage”: “abcd”,
“autoGrantPermissions”: “true”,
“platformName”: “Android”,
“udid”: “ZY2235F2FB”,
“deviceName”: “Motorola”,
“fullReset”: “false”,
“version”: “6.0.1”,
“platform”: “ANDROID”,
“systemPort”: “5001”
},
“capabilities”: {
“firstMatch”: [
{
“appium:app”: “C:\Users\vaibhav.sharma\Latest WorkSpace\IDIAutomation\src\main\abcd.apk”,
“appium:appActivity”: “abcd”,
“appium:appPackage”: “abcd”,
“appium:autoGrantPermissions”: “true”,
“appium:deviceName”: “Motorola”,
“appium:fullReset”: “false”,
“platform”: “ANDROID”,
“platformName”: “android”,
“appium:systemPort”: “5001”,
“appium:udid”: “ZY2235F2FB”,
“version”: “6.0.1”
}
]
}
}
2019-01-01 18:21:50.059:WARN:osjs.HttpChannel:qtp510464020-19: /wd/hub/session java.io.IOException: org.openqa.grid.common.exception.GridException: Cannot extract a capabilities from the request: {
“desiredCapabilities”: {
“app”: “C:\Users\vaibhav.sharma\Latest WorkSpace\IDIAutomation\src\main\abcd.apk”,
“appActivity”: “abcd”,
“appPackage”: “abcd”,
“autoGrantPermissions”: “true”,
“platformName”: “Android”,
“udid”: “7e6faae4”,
“deviceName”: “Lenevo”,
“fullReset”: “false”,
“version”: “5.1.1”,
“platform”: “ANDROID”,
“systemPort”: “5000”
},
“capabilities”: {
“firstMatch”: [
{
“appium:app”: “C:\Users\vaibhav.sharma\Latest WorkSpace\IDIAutomation\src\main\abcd”,
“appium:appActivity”: “abcd”,
“appium:appPackage”: “abcd”,
“appium:autoGrantPermissions”: “true”,
“appium:deviceName”: “Lenevo”,
“appium:fullReset”: “false”,
“platform”: “ANDROID”,
“platformName”: “android”,
“appium:systemPort”: “5000”,
“appium:udid”: “7e6faae4”,
“version”: “5.1.1”
}
]
}
}

Could you try with 3.14?
I faced an issue with 3.141.59 before as I addressed in previous comment. (I haven’t taken a look yet.)

And can you share your appium server log?
Your attached log was grid’s log. If something happens between Grid and Appium server, we probably can observe something there.

@KazuCocoa I did change all dependency to 3.14 … below are the logs console
3.13 I tried but getting errors for jar compatibility

org.openqa.selenium.WebDriverException: java.lang.NullPointerException
Build info: version: ‘3.14.0’, revision: ‘aacccce0’, time: ‘2018-08-02T20:19:58.91Z’
System info: host: ‘VAIBHAVS-LAPTOP’, ip: ‘192.168.56.1’, os.name: ‘Windows 7’, os.arch: ‘amd64’, os.version: ‘6.1’, java.version: ‘1.8.0_51’
Driver info: driver.version: unknown
at io.appium.java_client.pagefactory.AppiumElementLocator$WaitingFunction.apply(AppiumElementLocator.java:192)
at io.appium.java_client.pagefactory.AppiumElementLocator$WaitingFunction.apply(AppiumElementLocator.java:1)
at org.openqa.selenium.support.ui.FluentWait.until(FluentWait.java:260)
at io.appium.java_client.pagefactory.AppiumElementLocator.waitFor(AppiumElementLocator.java:99)
at io.appium.java_client.pagefactory.AppiumElementLocator.findElement(AppiumElementLocator.java:119)
at io.appium.java_client.pagefactory.interceptors.InterceptorOfASingleElement.intercept(InterceptorOfASingleElement.java:59)
at org.openqa.selenium.remote.RemoteWebElement$$EnhancerByCGLIB$$d27c0df4.getText()
at TestCases.Smoke.StartEkyc(Smoke.java:31)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException
at io.appium.java_client.pagefactory.AppiumElementLocator.lambda$0(AppiumElementLocator.java:120)
at io.appium.java_client.pagefactory.AppiumElementLocator$$Lambda$283/336833475.get(Unknown Source)
at io.appium.java_client.pagefactory.AppiumElementLocator$WaitingFunction.apply(AppiumElementLocator.java:172)
… 20 more

Can you share a log like below which is available by Appium server?

$ appium
[Appium] Welcome to Appium v1.11.0-beta.2 (REV e793e279f91217301e809e5deaad0b85ce0c3802)
[Appium] Appium REST http interface listener started on 0.0.0.0:4723
[HTTP] --> POST /wd/hub/session
[HTTP] {"desiredCapabilities":{"platformName":"ios","automationName":"XCUITest","app":"/Users/kazuaki/GitHub/ruby_lib_core/test/functional/app/UICatalog.app.zip","platformVersion":"11.4","deviceName":"iPhone 8","useJSONSource":true,"someCapability":"some_capability","newCommandTimeout":120,"wdaLocalPort":8100,"waitForQuiescence":true,"reduceMotion":true,"screenshotQuality":2},"capabilities":{"firstMatch":[{"platformName":"ios","appium:automationName":"XCUITest","appium:app":"/Users/kazuaki/GitHub/ruby_lib_core/test/functional/app/UICatalog.app.zip","appium:platformVersion":"11.4","appium:deviceName":"iPhone 8","appium:useJSONSource":true,"appium:someCapability":"some_capability","appium:newCommandTimeout":120,"appium:wdaLocalPort":8100,"appium:waitForQuiescence":true,"appium:reduceMotion":true,"appium:screenshotQuality":2}]}}
[debug] [W3C] Calling AppiumDriver.createSession() with args: [{"platformName":"ios","automationName":"XCUITest","app":"/Users/kazuaki/GitHub/ruby_lib_core/test/functional/app/UICatalog.app.zip","platformVersion":"11.4","deviceName":"iPhone 8","useJSONSource":true,"someCapability":"some_capability","newCommandTimeout":120,"wdaLocalPort":8100,"waitForQuiescence":true,"reduceMotion":true,"screenshotQuality":2},null,{"firstMatch":[{"platformName":"ios","appium:automationName":"XCUITest","appium:app":"/Users/kazuaki/GitHub/ruby_lib_core/test/functional/app/UICatalog.app.zip","appium:platformVersion":"11.4","appium:deviceName":"iPhone 8","appium:useJSONSource":true,"appium:someCapability":"some_capability","appium:newCommandTimeout":120,"appium:wdaLocalPort":8100,"appium:waitForQuiescence":true,"appium:reduceMotion":true,"appium:screenshotQuality":2}]}]
[debug] [BaseDriver] Event 'newSessionRequested' logged at 1546597779810 (19:29:39 GMT+0900 (Japan Standard Time))
[Appium] Creating new XCUITestDriver (v2.104.0) session
[Appium] Capabilities:
[Appium]   platformName: ios
[Appium]   automationName: XCUITest
[Appium]   app: /Users/kazuaki/GitHub/ruby_lib_core/test/functional/app/UICatalog.app.zip
[Appium]   platformVersion: 11.4
[Appium]   deviceName: iPhone 8
[Appium]   useJSONSource: true
[Appium]   someCapability: some_capability
[Appium]   newCommandTimeout: 120
[Appium]   wdaLocalPort: 8100
[Appium]   waitForQuiescence: true
[Appium]   reduceMotion: true
[Appium]   screenshotQuality: 2
[debug] [BaseDriver] W3C capabilities {"alwaysMatch":{"platformNa... and MJSONWP desired capabilities {"platformName":"ios","auto... were provided
[debug] [BaseDriver] Creating session with W3C capabilities: {"alwaysMatch":{"platformNa...
[BaseDriver] The following capabilities were provided, but are not recognized by appium: someCapability.
[BaseDriver] Session created with session id: 9eee4bb2-8afa-431e-b772-d0080855648e
(node:49664) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
...

@Aleksei I am confused can you advise as what are server logs as requested above.In eclipse console I see logs which log is that…
As I am using eclipse in workspace I do see a log folder.

@KazuCocoa
As read on forums I have implemented the code and the below line throws exception…Till I get some some from Aleksei may be it can be some hint
Log.info(" Thread below* ");
ThreadLocalDriver.setTLDriver(new AndroidDriver(new URL(“http://127.0.0.1:4444/wd/hub”),capabilities));
driver = ThreadLocalDriver.getTLDriver();

@Aleksei any advise on above…

@vsharma sorry no idea. try switch to latest Appium java-client + latest selenium.

@Aleksei my … I should have been more clear I needed info on Selenium log what Kazu is asking for.

@vsharma start your node manualy in some terminal/command line window. and get logs there i guess…

Hi @cyoung2727 please share logs if ur set up worked…

Hi there, I’m working on getting the Selenium log set up today, and will try to get the logs attached asap. The latest client and appium versions still aren’t working for me though, but maybe having some visibility on the grid logs will be helpful.

My other logs are very similar to yours @vsharma, but here’s a gist to one I ran not too long ago. This has java-client 3.13 as you can see, but there error is the same. https://gist.github.com/cdnyoung/243625ce1a75a31091d1f78670a716d3

I’ve been stuck on this for months now, and I keep coming back to there being something wrong with the way the caps json is being read. Maybe there’s some dependency that is missing that needs to be updated, or maybe I am formatting them incorrectly, but I haven’t changed our json files since the upgrade, so it’s got to be something withint he formatting… maybe? So difficult to tell here…

I updated things like Carthage, node, appium (and the appium java-client), java, selenium hub and client, but still no luck.

I’ll come back when I have more info!