Thanks @Aleksei I am not sure on this approach but would like to try… do you have reference link for same as I can learn.
I think the way is like below. Launch multiple appium servers on local and create sessions for them. We can control sessions connecting to http://127.0.0.1:4723/wd/hub
or http://127.0.0.1:4725/wd/hub
. Then, you need to take care of port conflicts.
$ appium -p 4723 # Appium server communicate with `4723` port
$ appium -p 4725 # Appium server communicate with `4725` port
http://appium.io/docs/en/writing-running-appium/server-args/1
What selenium grid did you try? I have tested them with https://github.com/appium/ruby_lib/tree/master/grid1 before. (2.53 ~ 3.14.0) I will take a look the cause.
@KazuCocoa I had tried this
java -jar selenium-server-standalone-3.13.0.jar -role hub
@KazuCocoa as I understand as I read forums in my json I ha given as below
http://127.0.0.1:5000/wd/hub"
where 5000 was my server instance port
Similarly I had done
http://127.0.0.1:5001/wd/hub"
@vsharma remember! Each appium server accept own appium port should have dirrerent other set of ports depending on platform you are using: iOS or Android.
E.g. “bootstrap-port” port for Android.
@Aleksei as read on forums when launching appium server instance I did define different BP in my case for lenevo it was 4724 or is it something else ur referring too?
Motorola 4275
@KazuCocoa in the logs I also see the following
20:21:20.520 WARN [DefaultGridRegistry.removeIfPresent] - Cleaning up stale test sessions on the unregistered node http://127.0.0.1:5000
2018-12-24 20:22:30.096:WARN:osjs.HttpChannel:qtp1846412426-12: /wd/hub/session java.io.IOException: org.openqa.grid.common.exception.GridException: Cannot extract a capabilities from the request: {
“desiredCapabilities”: {
I am unclear how the values are read?
eg:- I see in logs as
"7e6faae4": “udid”,
in capabilities they are defiened as
"udid" :“7e6faae4”:
Is this correct?
Also tried the below link by performing maven clean >install > test but still the same.
https://stackoverflow.com/questions/51084484/org-openqa-selenium-json-jsonoutput-writeljava-lang-objectljava-lang-reflect-t1
Something wrong in my capabilties?
Yes, as you addressed, "7e6faae4": “udid”,
should be "udid" :“7e6faae4”
.
"5.1.1": "systemPort",
"5000": "platform"
"7xxxxx": "udid"
"Android": "platformVersion"
must be:
"systemPort": "5000",
"platform": "Android",
"platformVersion": "5.1.1",
"udid": "7xxxxx"
Do you have any chance to try out newer grid?
If the bug is in grid server, it probably works after 3.14.0
(I tested with the version before. Then, it create session was succeeded.)
Did you already try the lates Java client via jitpack? It is not 6.1.0 from maven. (We have an issue to publish the library, so we currently use jitpack as a workaround.) Please follow the repository’s readme to install it via jitpack.
If the cause is selenium grid’s parsing capability issue, the latest Java-client has the fix.
BTW, I tested with https://github.com/appium/ruby_lib/tree/master/grid1 . The ruby version also has the same fix with issue#1010 in Java client.
Hi @KazuCocoa
I did download the same
https://jitpack.io/#appium/java-client/0cb3fcbd544
com.github.appium
java-client
0cb3fcbd54
But still the same…
@KazuCocoa client repo?
Can you please share me the url as I am not aware…
Also should I share this discussion link there too?
https://github.com/appium/java-client2 is.
Yes, it is helpful to catch up with the issue > link
I tried to run https://github.com/appium/java-client/blob/1991a8a0f9e4a3ff467dbb713cb5c51c8edc060f/src/test/java/io/appium/java_client/ios/IOSDriverTest.java1 with 3.13.0, 3.14 and 3.141.59. 3.13 and 3.14 succeeded to run. 3.141.59 had an issue in probably grid side? (have not investigated though). The grid configuration was he same as ruby_core’s one I attached the above.
[HTTP] --> GET /wd/hub/status
[HTTP] {}
[debug] [GENERIC] Calling AppiumDriver.getStatus() with args: []
[debug] [GENERIC] Responding to client with driver.getStatus() result: {"build":{"version":"1.11.0-beta.2","git-sha":"e793e279f91217301e809e5deaad0b85ce0c3802","built":"2018-12-21 17:20:20 -0500"}}
[HTTP] <-- GET /wd/hub/status 200 1 ms - 164
[HTTP]
[HTTP] --> POST /wd/hub/session
[HTTP] {"desiredCapabilities":{"app":"/Users/kazu/GitHub/java-client/src/test/java/io/appium/java_client/TestApp.app.zip","server:CONFIG_UUID":"41d25297-cc13-49cc-ad8a-8b78ac18f327","platformVersion":"11.4","automationName":"XCuiTest","platformName":"ios","deviceName":"iPhone X","launchTimeout":500000},"capabilities":{"firstMatch":[{"platformName":"ios","server:CONFIG_UUID":"41d25297-cc13-49cc-ad8a-8b78ac18f327"}]}}
[debug] [W3C] Calling AppiumDriver.createSession() with args: [{"app":"/Users/kazu/GitHub/java-client/src/test/java/io/appium/java_client/TestApp.app.zip","server:CONFIG_UUID":"41d25297-cc13-49cc-ad8a-8b78ac18f327","platformVersion":"11.4","automationName":"XCuiTest","platformName":"ios","deviceName":"iPhone X","launchTimeout":500000},null,{"firstMatch":[{"platformName":"ios","server:CONFIG_UUID":"41d25297-cc13-49cc-ad8a-8b78ac18f327"}]}]
[debug] [BaseDriver] Event 'newSessionRequested' logged at 1545836171483 (23:56:11 GMT+0900 (Japan Standard Time))
[Appium] Could not parse W3C capabilities: 'deviceName' can't be blank
[Appium] Trying to fix W3C capabilities by merging them with JSONWP caps
[BaseDriver] The capabilities ["app","platformVersion","automationName","deviceName","launchTimeout"] are not standard capabilities and should have an extension prefix
[Appium] Creating new XCUITestDriver (v2.104.0) session
[Appium] Capabilities:
[Appium] app: /Users/kazuaki/GitHub/java-client/src/test/java/io/appium/java_client/TestApp.app.zip
[Appium] platformVersion: 11.4
[Appium] automationName: XCuiTest
[Appium] deviceName: iPhone X
[Appium] launchTimeout: 500000
[Appium] platformName: ios
[Appium] server:CONFIG_UUID: 41d25297-cc13-49cc-ad8a-8b78ac18f327
[debug] [BaseDriver] W3C capabilities {"alwaysMatch":{"appium:app... and MJSONWP desired capabilities {"app":"/Users/kazuaki/GitH... were provided
[debug] [BaseDriver] Creating session with W3C capabilities: {"alwaysMatch":{"appium:app...
[BaseDriver] The following capabilities were provided, but are not recognized by appium: server:CONFIG_UUID.
[BaseDriver] Session created with session id: d1173cec-ecea-432b-b530-3ec659d56d08
[debug] [XCUITest] Current user: 'kazuaki'
[HTTP] --> GET /wd/hub/status
[HTTP] {}
[debug] [GENERIC] Calling AppiumDriver.getStatus() with args: []
The above was a part of Appium log which was registered with the grid. Appium clients worked well.
I noticed capabilities you attached in https://discuss-new.appium.io/uploads/default/original/2X/f/fe7545f06f408ed5e9cd3486ec08f76820745d84.JPG3 was grid side. What capability can you see in http://localhost:4444/grid/console ? Was it correct?
@KazuCocoa
Yes it looks ok localhost
Do let me know if anything else is required…Morning i will raise ticket once you give nod.
@KazuCocoa today I tried again this time I added device name in parameter and did a rerun…
I see some other exception in logs
the value “appium:udid”: “ZY2235F2FB”, is displayed as expected in logs though… but there is exception
2018-12-27 16:39:53.673:WARN:osjs.HttpChannel:qtp510464020-12: /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”: “abc”,
“appPackage”: “abc”,
“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”: “”,
“appium:appPackage”: “”,
“appium:autoGrantPermissions”: “true”,
“appium:deviceName”: “Motorola”,
“appium:fullReset”: “false”,
“platform”: “ANDROID”,
“platformName”: “android”,
“appium:systemPort”: “5001”,
“appium:udid”: “ZY2235F2FB”,
“version”: “6.0.1”
}
]
}
org.openqa.selenium.WebDriverException: java.lang.NullPointerException
Build info: version: ‘3.141.5’, revision: ‘d54ebd709a’, time: '2018-11-06T11:42:16’
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:249)
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$214/1013481204.get(Unknown Source)
at io.appium.java_client.pagefactory.AppiumElementLocator$WaitingFunction.apply(AppiumElementLocator.java:172)
… 20 more
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.)