java-client
java-client copied to clipboard
Unable to run simple parallel test with appium using selenium grid
The problem
I am running a simple demo test to test out parallel testing with appium, selenium grid and testNG. I am getting a session not known error.
Environment
Appium 6.1.0 selenium-server and selenium-java - 3.141.59 testng - 7.4.0
Details
My test is as follows:
`@Test
public void test1() {
DesiredCapabilities caps = new DesiredCapabilities();
try {
System.out.println("Execution started");
caps.setCapability("platformName", "Android");
caps.setCapability("deviceName", "R52N20ABC");
caps.setCapability("platformVersion", "10.0");
caps.setCapability("udid", "R52N20ABC");
caps.setCapability("appPackage", "CP.Android");
caps.setCapability("automationName", "uiautomator2");
caps.setCapability("appActivity", "crc69e3927.ActivityLicenseBrowse");
caps.setCapability("noReset", true);
caps.setCapability("systemPort", "8201");
WebDriver driver = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"), caps);
System.out.println("Execution ended");
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}`
The following error is seen:
[RemoteTestNG] detected TestNG version 7.4.0
Execution started
FAILED: test1
org.openqa.selenium.NoSuchSessionException: The session identified by 31d74ed5-d2a5-4d63-a758-723062cac718 is not known
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'PF2JP03M', ip: '192.168.137.1', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_261'
Driver info: driver.version: RemoteWebDriver
remote stacktrace: io.appium.uiautomator2.common.exceptions.NoSuchDriverException: The session identified by 31d74ed5-d2a5-4d63-a758-723062cac718 is not known
at io.appium.uiautomator2.handler.request.SafeRequestHandler.handle(SafeRequestHandler.java:54)
at io.appium.uiautomator2.server.AppiumServlet.handleRequest(AppiumServlet.java:264)
at io.appium.uiautomator2.server.AppiumServlet.handleHttpRequest(AppiumServlet.java:258)
at io.appium.uiautomator2.http.ServerHandler.channelRead(ServerHandler.java:68)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345)
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345)
at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:435)
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:293)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:267)
at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:250)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345)
at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:266)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1294)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:911)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:611)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:552)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:466)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:438)
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:140)
at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:144)
at java.lang.Thread.run(Thread.java:919)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.openqa.selenium.remote.W3CHandshakeResponse.lambda$errorHandler$0(W3CHandshakeResponse.java:62)
at org.openqa.selenium.remote.HandshakeResponse.lambda$getResponseFunction$0(HandshakeResponse.java:30)
at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$0(ProtocolHandshake.java:126)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.Spliterators$ArraySpliterator.tryAdvance(Spliterators.java:958)
at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126)
at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:499)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:486)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
at java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:152)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:464)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:128)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:74)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:136)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:213)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:131)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:144)
at SeleniumGridDemo.sel.com.test.grid.AppiumGridDemo.test1(AppiumGridDemo.java:28)
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:498)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:133)
at org.testng.internal.TestInvoker.invokeMethod(TestInvoker.java:598)
at org.testng.internal.TestInvoker.invokeTestMethod(TestInvoker.java:173)
at org.testng.internal.MethodRunner.runInSequence(MethodRunner.java:46)
at org.testng.internal.TestInvoker$MethodInvocationAgent.invoke(TestInvoker.java:824)
at org.testng.internal.TestInvoker.invokeTestMethods(TestInvoker.java:146)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:146)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:128)
at java.util.ArrayList.forEach(ArrayList.java:1259)
at org.testng.TestRunner.privateRun(TestRunner.java:794)
at org.testng.TestRunner.run(TestRunner.java:596)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:377)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:371)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:332)
at org.testng.SuiteRunner.run(SuiteRunner.java:276)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:53)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:96)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1212)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1134)
at org.testng.TestNG.runSuites(TestNG.java:1063)
at org.testng.TestNG.run(TestNG.java:1031)
at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:115)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77)
===============================================
Default test
Tests run: 1, Failures: 1, Skips: 0
===============================================`
```
## Link to Appium logs
Create a [GIST](https://gist.github.com) which is a paste of your _full_ Appium logs, and link them here.
Do _NOT_ paste your full Appium logs here, as it will make this issue very long and hard to read!
If you are reporting a bug, _always_ include Appium logs!
## Code To Reproduce Issue [ Good To Have ]
Please remember that with sample code it's easier to reproduce the bug and it's much faster to fix it.
Please git clone https://github.com/appium/appium and from the `sample-code` directory, use one of your favorite languages and sample apps to reproduce the issue.
In case a similar scenario is missing in sample-code, please submit a PR with one of the sample apps provided.
What does the error mean and how do i fix it?
Could you share the appium log and grid's log as GIST?
This is my appium node log. Just wanted to mention, that I have 2 real android devices with exact same configurations - same Android versions, but one of them works fine with the testng script and the other one throws this error:
C:\Selenium\grid-mobile-work>appium -a 127.0.0.1 -p 4723 --nodeconfig C:\Selenium\grid-mobile-work\R52N20ALVDN.json
[Appium] Welcome to Appium v1.22.0
[Appium] Non-default server args:
[Appium] address: 127.0.0.1
[Appium] nodeconfig: C:\Selenium\grid-mobile-work\R52N20ALVDN.json
[debug] [Appium] Starting auto register thread for the grid. Will try to register every 5000 ms.
[Appium] Appium REST http interface listener started on 127.0.0.1:4723
[debug] [Appium] Appium successfully registered with the the grid on http://127.0.0.1:4444
[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.22.0"}}
[HTTP] <-- GET /wd/hub/status 200 5 ms - 68
[HTTP]
[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.22.0"}}
[HTTP] <-- GET /wd/hub/status 200 6 ms - 68
[HTTP]
[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.22.0"}}
[HTTP] <-- GET /wd/hub/status 200 2 ms - 68
[HTTP]
[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.22.0"}}
[HTTP] <-- GET /wd/hub/status 200 2 ms - 68
[HTTP]
[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.22.0"}}
[HTTP] <-- GET /wd/hub/status 200 8 ms - 68
[HTTP]
[HTTP] --> POST /wd/hub/session
[HTTP] {"desiredCapabilities":{"appActivity":"crc6429e3927486beccbc.ActivityLicenseBrowse","appPackage":"CP.Android","server:CONFIG_UUID":"779905c4-4f5c-41cf-b6c9-102d31574e28","noReset":"true","platformVersion":"10","automationName":"uiautomator2","platformName":"android","udid":"R52N20ALVDN","deviceName":"R52N20ALVDN","systemPort":"8202"},"capabilities":{"firstMatch":[{"platformName":"android","server:CONFIG_UUID":"779905c4-4f5c-41cf-b6c9-102d31574e28"}]}}
[debug] [W3C] Calling AppiumDriver.createSession() with args: [{"appActivity":"crc6429e3927486beccbc.ActivityLicenseBrowse","appPackage":"CP.Android","server:CONFIG_UUID":"779905c4-4f5c-41cf-b6c9-102d31574e28","noReset":"true","platformVersion":"10","automationName":"uiautomator2","platformName":"android","udid":"R52N20ALVDN","deviceName":"R52N20ALVDN","systemPort":"8202"},null,{"firstMatch":[{"platformName":"android","server:CONFIG_UUID":"779905c4-4f5c-41cf-b6c9-102d31574e28"}]}]
[debug] [BaseDriver] Event 'newSessionRequested' logged at 1636481155301 (10:05:55 GMT-0800 (Pacific Standard Time))
[Appium] The following capabilities were provided in the JSONWP desired capabilities that are missing in W3C capabilities: ["appActivity","appPackage","noReset","platformVersion","automationName","udid","deviceName","systemPort"]
[Appium] Trying to fix W3C capabilities by merging them with JSONWP caps
[BaseDriver] The following capabilities are not standard capabilities and should have an extension prefix:
[BaseDriver] appActivity
[BaseDriver] appPackage
[BaseDriver] noReset
[BaseDriver] platformVersion
[BaseDriver] automationName
[BaseDriver] udid
[BaseDriver] deviceName
[BaseDriver] systemPort
[Appium] Appium v1.22.0 creating new AndroidUiautomator2Driver (v1.69.0) session
[debug] [BaseDriver] W3C capabilities and MJSONWP desired capabilities were provided
[debug] [BaseDriver] Creating session with W3C capabilities: {
[debug] [BaseDriver] "alwaysMatch": {
[debug] [BaseDriver] "appium:appActivity": "crc6429e3927486beccbc.ActivityLicenseBrowse",
[debug] [BaseDriver] "appium:appPackage": "CP.Android",
[debug] [BaseDriver] "appium:noReset": "true",
[debug] [BaseDriver] "appium:platformVersion": "10",
[debug] [BaseDriver] "appium:automationName": "uiautomator2",
[debug] [BaseDriver] "appium:udid": "R52N20ALVDN",
[debug] [BaseDriver] "appium:deviceName": "R52N20ALVDN",
[debug] [BaseDriver] "appium:systemPort": "8202",
[debug] [BaseDriver] "platformName": "android",
[debug] [BaseDriver] "server:CONFIG_UUID": "779905c4-4f5c-41cf-b6c9-102d31574e28"
[debug] [BaseDriver] },
[debug] [BaseDriver] "firstMatch": [
[debug] [BaseDriver] {}
[debug] [BaseDriver] ]
[debug] [BaseDriver] }
[BaseDriver] Number capability passed in as string. Functionality may be compromised.
[BaseDriver] Capability 'noReset' changed from string to boolean. This may cause unexpected behavior
[BaseDriver] Capability 'systemPort' changed from string ('8202') to integer (8202). This may cause unexpected behavior
[BaseDriver] The following capabilities were provided, but are not recognized by Appium:
[BaseDriver] server:CONFIG_UUID
[BaseDriver] Session created with session id: 96a6c814-0a70-4990-ba91-3a2a861f8fba
[UiAutomator2] Starting 'CP.Android' directly on the device
[ADB] Found 1 'build-tools' folders under 'C:\Users\skhandekar\AppData\Local\Android\Sdk' (newest first):
[ADB] C:/Users/skhandekar/AppData/Local/Android/Sdk/build-tools/30.0.3
[ADB] Using 'adb.exe' from 'C:\Users\skhandekar\AppData\Local\Android\Sdk\platform-tools\adb.exe'
[debug] [ADB] Running 'C:\Users\skhandekar\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 start-server'
[AndroidDriver] Retrieving device list
[debug] [ADB] Trying to find a connected android device
[debug] [ADB] Getting connected devices
[debug] [ADB] Connected devices: [{"udid":"R52N20ALVDN","state":"device"},{"udid":"R52N20AM7XK","state":"device"}]
[AndroidDriver] Using device: R52N20ALVDN
[ADB] Using 'adb.exe' from 'C:\Users\skhandekar\AppData\Local\Android\Sdk\platform-tools\adb.exe'
[debug] [ADB] Running 'C:\Users\skhandekar\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 start-server'
[debug] [ADB] Setting device id to R52N20ALVDN
[debug] [ADB] Running 'C:\Users\skhandekar\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s R52N20ALVDN shell getprop ro.build.version.sdk'
[debug] [ADB] Current device property 'ro.build.version.sdk': 29
[ADB] Getting device platform version
[debug] [ADB] Running 'C:\Users\skhandekar\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s R52N20ALVDN shell getprop ro.build.version.release'
[debug] [ADB] Current device property 'ro.build.version.release': 10
[debug] [ADB] Device API level: 29
[UiAutomator2] Relaxing hidden api policy
[debug] [ADB] Running 'C:\Users\skhandekar\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s R52N20ALVDN shell 'settings put global hidden_api_policy_pre_p_apps 1;settings put global hidden_api_policy_p_apps 1;settings put global hidden_api_policy 1''
[AndroidDriver] No app sent in, not parsing package/activity
[debug] [ADB] Running 'C:\Users\skhandekar\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s R52N20ALVDN wait-for-device'
[debug] [ADB] Running 'C:\Users\skhandekar\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s R52N20ALVDN shell echo ping'
[debug] [AndroidDriver] Pushing settings apk to device...
[debug] [ADB] Getting install status for io.appium.settings
[debug] [ADB] Running 'C:\Users\skhandekar\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s R52N20ALVDN shell dumpsys package io.appium.settings'
[debug] [ADB] 'io.appium.settings' is installed
[debug] [ADB] Getting package info for 'io.appium.settings'
[debug] [ADB] Running 'C:\Users\skhandekar\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s R52N20ALVDN shell dumpsys package io.appium.settings'
[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.22.0"}}
[HTTP] <-- GET /wd/hub/status 200 1 ms - 68
[HTTP]
[debug] [ADB] The version name of the installed 'io.appium.settings' is greater or equal to the application version name ('3.4.0' >= '3.4.0')
[debug] [ADB] There is no need to install/upgrade 'C:\Users\skhandekar\AppData\Roaming\npm\node_modules\appium\node_modules\io.appium.settings\apks\settings_apk-debug.apk'
[debug] [ADB] Getting IDs of all 'io.appium.settings' processes
[debug] [ADB] Running 'C:\Users\skhandekar\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s R52N20ALVDN shell 'pgrep --help; echo $?''
[debug] [ADB] Running 'C:\Users\skhandekar\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s R52N20ALVDN shell pgrep -f \(\[\[:blank:\]\]\|\^\)io\.appium\.settings\(\[\[:blank:\]\]\|\$\)'
[debug] [AndroidDriver] io.appium.settings is already running. There is no need to reset its permissions.
[debug] [ADB] Running 'C:\Users\skhandekar\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s R52N20ALVDN shell appops set io.appium.settings android:mock_location allow'
[debug] [Logcat] Starting logs capture with command: C:\\Users\\skhandekar\\AppData\\Local\\Android\\Sdk\\platform-tools\\adb.exe -P 5037 -s R52N20ALVDN logcat -v threadtime
[debug] [UiAutomator2] Forwarding UiAutomator2 Server port 6790 to local port 8202
[debug] [ADB] Forwarding system: 8202 to device: 6790
[debug] [ADB] Running 'C:\Users\skhandekar\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s R52N20ALVDN forward tcp:8202 tcp:6790'
[debug] [ADB] Getting install status for io.appium.uiautomator2.server
[debug] [ADB] Running 'C:\Users\skhandekar\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s R52N20ALVDN shell dumpsys package io.appium.uiautomator2.server'
[debug] [ADB] 'io.appium.uiautomator2.server' is installed
[debug] [ADB] Getting package info for 'io.appium.uiautomator2.server'
[debug] [ADB] Running 'C:\Users\skhandekar\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s R52N20ALVDN shell dumpsys package io.appium.uiautomator2.server'
[debug] [ADB] The version name of the installed 'io.appium.uiautomator2.server' is greater or equal to the application version name ('4.24.0' >= '4.24.0')
[debug] [UiAutomator2] io.appium.uiautomator2.server installation state: sameVersionInstalled
[debug] [ADB] Checking app cert for C:\Users\skhandekar\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v4.24.0.apk
[ADB] Using 'apksigner.jar' from 'C:\Users\skhandekar\AppData\Local\Android\Sdk\build-tools\30.0.3\lib\apksigner.jar'
[debug] [ADB] Starting apksigner: 'C:\\Program Files\\Java\\jdk1.8.0_261\\bin\\java.exe' -Xmx1024M -Xss1m -jar C:\\Users\\skhandekar\\AppData\\Local\\Android\\Sdk\\build-tools\\30.0.3\\lib\\apksigner.jar verify --print-certs C:\\Users\\skhandekar\\AppData\\Roaming\\npm\\node_modules\\appium\\node_modules\\appium-uiautomator2-server\\apks\\appium-uiautomator2-server-v4.24.0.apk
[debug] [ADB] apksigner stdout: Signer #1 certificate DN: [email protected], CN=Android, OU=Android, O=Android, L=Mountain View, ST=California, C=US
[debug] [ADB] Signer #1 certificate SHA-256 digest: a40da80a59d170caa950cf15c18c454d47a39b26989d8b640ecd745ba71bf5dc
[debug] [ADB] Signer #1 certificate SHA-1 digest: 61ed377e85d386a8dfee6b864bd85b0bfaa5af81
[debug] [ADB] Signer #1 certificate MD5 digest: e89b158e4bcf988ebd09eb83f5378e87
[debug] [ADB]
[debug] [ADB] sha256 hash did match for 'appium-uiautomator2-server-v4.24.0.apk'
[ADB] 'C:\Users\skhandekar\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v4.24.0.apk' is signed with the default certificate
[debug] [ADB] Getting install status for io.appium.uiautomator2.server.test
[debug] [ADB] Running 'C:\Users\skhandekar\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s R52N20ALVDN shell dumpsys package io.appium.uiautomator2.server.test'
[debug] [ADB] 'io.appium.uiautomator2.server.test' is installed
[debug] [ADB] Checking app cert for C:\Users\skhandekar\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-debug-androidTest.apk
[debug] [ADB] Starting apksigner: 'C:\\Program Files\\Java\\jdk1.8.0_261\\bin\\java.exe' -Xmx1024M -Xss1m -jar C:\\Users\\skhandekar\\AppData\\Local\\Android\\Sdk\\build-tools\\30.0.3\\lib\\apksigner.jar verify --print-certs C:\\Users\\skhandekar\\AppData\\Roaming\\npm\\node_modules\\appium\\node_modules\\appium-uiautomator2-server\\apks\\appium-uiautomator2-server-debug-androidTest.apk
[debug] [ADB] apksigner stdout: Signer #1 certificate DN: [email protected], CN=Android, OU=Android, O=Android, L=Mountain View, ST=California, C=US
[debug] [ADB] Signer #1 certificate SHA-256 digest: a40da80a59d170caa950cf15c18c454d47a39b26989d8b640ecd745ba71bf5dc
[debug] [ADB] Signer #1 certificate SHA-1 digest: 61ed377e85d386a8dfee6b864bd85b0bfaa5af81
[debug] [ADB] Signer #1 certificate MD5 digest: e89b158e4bcf988ebd09eb83f5378e87
[debug] [ADB]
[debug] [ADB] sha256 hash did match for 'appium-uiautomator2-server-debug-androidTest.apk'
[ADB] 'C:\Users\skhandekar\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-debug-androidTest.apk' is signed with the default certificate
[UiAutomator2] Server packages are not going to be (re)installed
[debug] [UiAutomator2] Waiting up to 30000ms for services to be available
[debug] [ADB] Running 'C:\Users\skhandekar\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s R52N20ALVDN shell pm list instrumentation'
[debug] [UiAutomator2] Instrumentation target 'io.appium.uiautomator2.server.test/androidx.test.runner.AndroidJUnitRunner' is available
[ADB] Adding packages ["io.appium.settings","io.appium.uiautomator2.server","io.appium.uiautomator2.server.test"] to Doze whitelist
[debug] [ADB] Got the following command chunks to execute: [["dumpsys","deviceidle","whitelist","+io.appium.settings",";","dumpsys","deviceidle","whitelist","+io.appium.uiautomator2.server",";","dumpsys","deviceidle","whitelist","+io.appium.uiautomator2.server.test",";"]]
[debug] [ADB] Running 'C:\Users\skhandekar\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s R52N20ALVDN shell dumpsys deviceidle whitelist +io.appium.settings ; dumpsys deviceidle whitelist +io.appium.uiautomator2.server ; dumpsys deviceidle whitelist +io.appium.uiautomator2.server.test ;'
[debug] [UiAutomator2] No app capability. Assuming it is already on the device
[debug] [UiAutomator2] Performing shallow cleanup of automation leftovers
[debug] [UiAutomator2] No obsolete sessions have been detected
[debug] [ADB] Running 'C:\Users\skhandekar\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s R52N20ALVDN shell am force-stop io.appium.uiautomator2.server.test'
[UiAutomator2] Starting UIAutomator2 server 4.24.0
[UiAutomator2] Using UIAutomator2 server from 'C:\Users\skhandekar\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v4.24.0.apk' and test from 'C:\Users\skhandekar\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-debug-androidTest.apk'
[UiAutomator2] Waiting up to 30000ms for UiAutomator2 to be online...
[debug] [ADB] Creating ADB subprocess with args: ["-P",5037,"-s","R52N20ALVDN","shell","am","instrument","-w","-e","disableAnalytics",true,"io.appium.uiautomator2.server.test/androidx.test.runner.AndroidJUnitRunner"]
[debug] [WD Proxy] Matched '/status' to command name 'getStatus'
[debug] [WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8202/wd/hub/status] with no body
[debug] [WD Proxy] Got response with status 200: {"sessionId":"None","value":{"message":"UiAutomator2 Server is ready to accept commands","ready":true}}
[debug] [UiAutomator2] The initialization of the instrumentation process took 36ms
[debug] [WD Proxy] Matched '/session' to command name 'createSession'
[debug] [WD Proxy] Proxying [POST /session] to [POST http://127.0.0.1:8202/wd/hub/session] with body: {"capabilities":{"firstMatch":[{"platform":"LINUX","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"platformName":"android","server:CONFIG_UUID":"779905c4-4f5c-41cf-b6c9-102d31574e28","appActivity":"crc6429e3927486beccbc.ActivityLicenseBrowse","appPackage":"CP.Android","noReset":true,"platformVersion":"10","automationName":"uiautomator2","udid":"R52N20ALVDN","deviceName":"R52N20ALVDN","systemPort":8202},"platformName":"android","server:CONFIG_UUID":"779905c4-4f5c-41cf-b6c9-102d31574e28","appActivity":"crc6429e3927486beccbc.ActivityLicenseBrowse","appPackage":"CP.Android","noReset":true,"platformVersion":"10","automationName":"uiautomator2","udid":"R52N20ALVDN","deviceName":"R52N20ALVDN","systemPort":8202,"deviceUDID":"R52N20ALVDN"}],"alwaysMatch":{}}}
[debug] [WD Proxy] Got response with status 200: {"sessionId":"04c6f468-1c60-4f7d-b13a-4fba1af7d29e","value":{"capabilities":{"firstMatch":[{"platform":"LINUX","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"platformName":"android","server:CONFIG_UUID":"779905c4-4f5c-41cf-b6c9-102d31574e28","appActivity":"crc6429e3927486beccbc.ActivityLicenseBrowse","appPackage":"CP.Android","noReset":true,"platformVersion":"10","automationName":"uiautomator2","udid":"R52N20ALVDN","deviceName":"R52N20ALVDN","systemPort":8202},"platformName":"android","server:CONFIG_UUID":"779905c4-4f5c-41cf-b6c9-102d31574e28","appActivity":"crc6429e3927486beccbc.ActivityLicenseBrowse","appPackage":".CP.Android","noReset":true,"platformVersion":"10","automationName":"uiautomator2","udid":"R52N20ALVDN","deviceName":"R52N20ALVDN","systemPort":8202,"deviceUDID":"R52N20ALVDN"}],"alwaysMatch":{}},"sessionId":"04c6f468-1c60-4f7d-b13a-4fba1af7d29e"}}
[WD Proxy] Determined the downstream protocol as 'W3C'
[debug] [WD Proxy] Proxying [GET /appium/device/info] to [GET http://127.0.0.1:8202/wd/hub/session/04c6f468-1c60-4f7d-b13a-4fba1af7d29e/appium/device/info] with no body
[debug] [WD Proxy] Got response with status 200: {"sessionId":"04c6f468-1c60-4f7d-b13a-4fba1af7d29e","value":{"androidId":"3e3280a9a8735db7","apiVersion":"29","bluetooth":{"state":"ON"},"brand":"samsung","carrierName":"","displayDensity":360,"locale":"en_US","manufacturer":"samsung","model":"SM-T860","networks":[{"capabilities":{"SSID":null,"linkDownBandwidthKbps":1048576,"linkUpstreamBandwidthKbps":1048576,"networkCapabilities":"NET_CAPABILITY_NOT_METERED,NET_CAPABILITY_INTERNET,NET_CAPABILITY_NOT_RESTRICTED,NET_CAPABILITY_TRUSTED,NET_CAPABILITY_NOT_VPN,NET_CAPABILITY_VALIDATED,NET_CAPABILITY_NOT_ROAMING,NET_CAPABILITY_FOREGROUND,NET_CAPABILITY_NOT_CONGESTED,NET_CAPABILITY_NOT_SUSPENDED","signalStrength":-48,"transportTypes":"TRANSPORT_WIFI"},"detailedState":"CONNECTED","extraInfo":null,"isAvailable":true,"isConnected":true,"isFailover":false,"isRoaming":false,"state":"CONNECTED","subtype":0,"subtypeName":"","type":1,"typeName":"WIFI"}],"platformVersion":"10","realDisplaySize":"2560x1600","timeZone":"America/Los_Angeles"}}
[debug] [ADB] Running 'C:\Users\skhandekar\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s R52N20ALVDN shell dumpsys window'
[AndroidDriver] Screen already unlocked, doing nothing
[UiAutomator2] Starting 'CP.Android/crc6429e3927486beccbc.ActivityLicenseBrowse and waiting for CP.Android/crc6429e3927486beccbc.ActivityLicenseBrowse'
[debug] [ADB] Running 'C:\Users\skhandekar\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s R52N20ALVDN shell am start -W -n .CP.Android/crc6429e3927486beccbc.ActivityLicenseBrowse -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000'
[debug] [Instrumentation] io.appium.uiautomator2.server.test.AppiumUiAutomator2Server:
[debug] [WD Proxy] Proxying [GET /appium/device/pixel_ratio] to [GET http://127.0.0.1:8202/wd/hub/session/04c6f468-1c60-4f7d-b13a-4fba1af7d29e/appium/device/pixel_ratio] with no body
[WD Proxy] Got response with status 404: {"sessionId":"04c6f468-1c60-4f7d-b13a-4fba1af7d29e","value":{"error":"invalid session id","message":"The session identified by 04c6f468-1c60-4f7d-b13a-4fba1af7d29e is not known","stacktrace":"io.appium.uiautomator2.common.exceptions.NoSuchDriverException: The session identified by 04c6f468-1c60-4f7d-b13a-4fba1af7d29e is not known\n\tat io.appium.uiautomator2.handler.request.SafeRequestHandler.handle(SafeRequestHandler.java:54)\n\tat io.appium.uiautomator2.server.AppiumServlet.handleRequest(AppiumServlet.java:264)\n\tat io.appium.uiautomator2.server.AppiumServlet.handleHttpRequest(AppiumServlet.java:258)\n\tat io.appium.uiautomator2.http.ServerHandler.channelRead(ServerHandler.java:68)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)\n\tat io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:3...
[debug] [W3C] Matched W3C error code 'invalid session id' to NoSuchDriverError
[debug] [UiAutomator2] Deleting UiAutomator2 session
[debug] [UiAutomator2] Deleting UiAutomator2 server session
[debug] [WD Proxy] Matched '/' to command name 'deleteSession'
[debug] [WD Proxy] Proxying [DELETE /] to [DELETE http://127.0.0.1:8202/wd/hub/session/04c6f468-1c60-4f7d-b13a-4fba1af7d29e] with no body
[WD Proxy] Got response with status 404: {"sessionId":"04c6f468-1c60-4f7d-b13a-4fba1af7d29e","value":{"error":"invalid session id","message":"The session identified by 04c6f468-1c60-4f7d-b13a-4fba1af7d29e is not known","stacktrace":"io.appium.uiautomator2.common.exceptions.NoSuchDriverException: The session identified by 04c6f468-1c60-4f7d-b13a-4fba1af7d29e is not known\n\tat io.appium.uiautomator2.handler.request.SafeRequestHandler.handle(SafeRequestHandler.java:54)\n\tat io.appium.uiautomator2.server.AppiumServlet.handleRequest(AppiumServlet.java:264)\n\tat io.appium.uiautomator2.server.AppiumServlet.handleHttpRequest(AppiumServlet.java:258)\n\tat io.appium.uiautomator2.http.ServerHandler.channelRead(ServerHandler.java:68)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)\n\tat io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:3...
[debug] [W3C] Matched W3C error code 'invalid session id' to NoSuchDriverError
[UiAutomator2] Did not get confirmation UiAutomator2 deleteSession worked; Error was: NoSuchDriverError: The session identified by 04c6f468-1c60-4f7d-b13a-4fba1af7d29e is not known
[debug] [ADB] Running 'C:\Users\skhandekar\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s R52N20ALVDN shell am force-stop CP.Android'
[debug] [Logcat] Stopping logcat capture
[debug] [ADB] Removing forwarded port socket connection: 8202
[debug] [ADB] Running 'C:\Users\skhandekar\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s R52N20ALVDN forward --remove tcp:8202'
[UiAutomator2] Restoring hidden api policy to the device default configuration
[debug] [ADB] Running 'C:\Users\skhandekar\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s R52N20ALVDN shell 'settings delete global hidden_api_policy_pre_p_apps;settings delete global hidden_api_policy_p_apps;settings delete global hidden_api_policy''
[debug] [BaseDriver] Event 'newSessionStarted' logged at 1636481160868 (10:06:00 GMT-0800 (Pacific Standard Time))
[debug] [W3C] Encountered internal error running command: io.appium.uiautomator2.common.exceptions.NoSuchDriverException: The session identified by 04c6f468-1c60-4f7d-b13a-4fba1af7d29e is not known
[debug] [W3C] at io.appium.uiautomator2.handler.request.SafeRequestHandler.handle(SafeRequestHandler.java:54)
[debug] [W3C] at io.appium.uiautomator2.server.AppiumServlet.handleRequest(AppiumServlet.java:264)
[debug] [W3C] at io.appium.uiautomator2.server.AppiumServlet.handleHttpRequest(AppiumServlet.java:258)
[debug] [W3C] at io.appium.uiautomator2.http.ServerHandler.channelRead(ServerHandler.java:68)
[debug] [W3C] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)
[debug] [W3C] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)
[debug] [W3C] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345)
[debug] [W3C] at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
[debug] [W3C] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)
[debug] [W3C] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)
[debug] [W3C] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345)
[debug] [W3C] at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:435)
[debug] [W3C] at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:293)
[debug] [W3C] at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:267)
[debug] [W3C] at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:250)
[debug] [W3C] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)
[debug] [W3C] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)
[debug] [W3C] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345)
[debug] [W3C] at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:266)
[debug] [W3C] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)
[debug] [W3C] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)
[debug] [W3C] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345)
[debug] [W3C] at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1294)
[debug] [W3C] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)
[debug] [W3C] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)
[debug] [W3C] at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:911)
[debug] [W3C] at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131)
[debug] [W3C] at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:611)
[debug] [W3C] at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:552)
[debug] [W3C] at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:466)
[debug] [W3C] at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:438)
[debug] [W3C] at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:140)
[debug] [W3C] at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:144)
[debug] [W3C] at java.lang.Thread.run(Thread.java:919)
[debug] [W3C]
[HTTP] <-- POST /wd/hub/session 404 5603 ms - 3691
[HTTP]
[HTTP] --> GET /wd/hub/status
[HTTP] {}
And this is my selenium grid logs:
C:\Selenium\grid-mobile-work>java -jar selenium-server-standalone-3.141.59.jar -role hub
10:05:19.330 INFO [GridLauncherV3.parse] - Selenium server version: 3.141.59, revision: e82be7d358
10:05:19.386 INFO [GridLauncherV3.lambda$buildLaunchers$5] - Launching Selenium Grid hub on port 4444
2021-11-09 10:05:19.716:INFO::main: Logging initialized @531ms to org.seleniumhq.jetty9.util.log.StdErrLog
10:05:20.075 INFO [Hub.start] - Selenium Grid hub is up and running
10:05:20.075 INFO [Hub.start] - Nodes should register to http://192.168.137.1:4444/grid/register/
10:05:20.075 INFO [Hub.start] - Clients should connect to http://192.168.137.1:4444/wd/hub
10:05:31.061 INFO [DefaultGridRegistry.add] - Registered a node http://127.0.0.1:4723
10:05:33.511 INFO [DefaultGridRegistry.add] - Registered a node http://127.0.0.1:4725
10:05:55.270 INFO [RequestHandler.process] - Got a request to create a new session: Capabilities {appActivity: crc6429e3927486beccbc.Activ..., appPackage: CP.Android, automationName: uiautomator2, deviceName: R52N20ALVDN, noReset: true, platformName: android, platformVersion: 10, systemPort: 8202, udid: R52N20ALVDN}
10:05:55.272 INFO [TestSlot.getNewSession] - Trying to create a new session on test slot {server:CONFIG_UUID=779905c4-4f5c-41cf-b6c9-102d31574e28, seleniumProtocol=WebDriver, platformVersion=10, automationName=UiAutomator2, browserName=Android, maxInstances=1, platformName=ANDROID, deviceName=R52N20ALVDN, platform=ANDROID, systemPort=8202}
10:06:00.910 INFO [ActiveTestSessions.updateReason] - Removed a session that had not yet assigned an external key d7b80978-72f3-4bec-bfb7-717c467c1b13, indicates failure in session creation BROWSER_TIMEOUT
10:06:55.017 INFO [DefaultGridRegistry.add] - Registered a node http://127.0.0.1:4723
10:06:55.017 WARN [DefaultGridRegistry.removeIfPresent] - Cleaning up stale test sessions on the unregistered node http://127.0.0.1:4723
My json is as follows:
{
"capabilities":
[
{
"browserName": "Android",
"deviceName": "R52N20ALVDN",
"platformVersion":"10",
"maxInstances": 1,
"platformName":"ANDROID",
"automationName": "UiAutomator2",
"systemPort": 8202
}
],
"configuration":
{
"cleanUpCycle":2000,
"timeout":30000,
"proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
"url":"http://127.0.0.1:4723/wd/hub",
"host": "127.0.0.1",
"port": 4723,
"maxSession": 1,
"register": true,
"registerCycle": 5000,
"hubPort": 4444,
"hubHost": "127.0.0.1"
}
}
This log from hub shows the two devices both running the same test script. The R52N20ALVDN one fails with some BROWSER_TIMEOUT exception (to be noted that this tablet has been used for non-parallel testing before and works perfectly fine. No changes have been made to tablet), while 'R52N20AM7XK' works just fine eachtime:
10:06:55.017 INFO [DefaultGridRegistry.add] - Registered a node http://127.0.0.1:4723
10:06:55.017 WARN [DefaultGridRegistry.removeIfPresent] - Cleaning up stale test sessions on the unregistered node http://127.0.0.1:4723
10:15:11.349 INFO [RequestHandler.process] - Got a request to create a new session: Capabilities {appActivity: crc6429e3927486beccbc.Activ..., appPackage: Nalu.CP.Android, automationName: uiautomator2, deviceName: R52N20ALVDN, noReset: true, platformName: android, platformVersion: 10, systemPort: 8202, udid: R52N20ALVDN}
10:15:11.350 INFO [TestSlot.getNewSession] - Trying to create a new session on test slot {server:CONFIG_UUID=0909876c-145b-4431-b323-ad8aabb73807, seleniumProtocol=WebDriver, platformVersion=10.0, automationName=UiAutomator2, browserName=Android, maxInstances=1, platformName=ANDROID, deviceName=R52N20AM7XK, platform=ANDROID, systemPort=8203}
10:15:20.192 INFO [ActiveTestSessions.updateReason] - Removed a session that had not yet assigned an external key 27a4c3b3-eb5f-4154-b298-2e7d8ede882f, indicates failure in session creation BROWSER_TIMEOUT
10:22:14.713 INFO [RequestHandler.process] - Got a request to create a new session: Capabilities {appActivity: crc6429e3927486beccbc.Activ..., appPackage: Nalu.CP.Android, automationName: uiautomator2, deviceName: R52N20AM7XK, noReset: true, platformName: android, platformVersion: 10, systemPort: 8203, udid: R52N20AM7XK}
10:22:14.713 INFO [TestSlot.getNewSession] - Trying to create a new session on test slot {server:CONFIG_UUID=105f5f0b-e017-411a-9b0f-644fdee46092, seleniumProtocol=WebDriver, platformVersion=10, automationName=UiAutomator2, browserName=Android, maxInstances=1, platformName=ANDROID, deviceName=R52N20ALVDN, platform=ANDROID, systemPort=8202}
2 real android devices with exact same configurations one of them works fine with the testng script and the other one throws this error:
two devices both running the same test script
Can I make sure these two devices run on different machine, or they run on a host but has different capabilities addressed in https://appium.io/docs/en/advanced-concepts/parallel-tests/ ?
if no, I would want to ensure capabilities addressed in https://appium.io/docs/en/advanced-concepts/parallel-tests/ should be unique per device.
They are two different tablets. I am providing capabilities as follows:
DesiredCapabilities caps = new DesiredCapabilities();
try {
System.out.println("Execution started test1");
caps.setCapability("platformName", "Android");
caps.setCapability("deviceName", "R52N20ALVDN");
caps.setCapability("platformVersion", "10");
caps.setCapability("udid", "R52N20ALVDN");
caps.setCapability("appPackage", "CP.Android");
caps.setCapability("automationName", "uiautomator2");
caps.setCapability("appActivity", "crc6429e3927486beccbc.ActivityLicenseBrowse");
caps.setCapability("systemPort", "8202");
caps.setCapability("noReset", "true");
WebDriver driver = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"), caps);
and,
DesiredCapabilities caps = new DesiredCapabilities();
try {
System.out.println("Execution started test1");
caps.setCapability("platformName", "Android");
caps.setCapability("deviceName", "R52N20AM7XK");
caps.setCapability("platformVersion", "10");
caps.setCapability("udid", "R52N20AM7XK");
caps.setCapability("appPackage", "CP.Android");
caps.setCapability("automationName", "uiautomator2");
caps.setCapability("appActivity", "crc6429e3927486beccbc.ActivityLicenseBrowse");
caps.setCapability("systemPort", "8203");
caps.setCapability("noReset", "true");
WebDriver driver = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"), caps);
Then, could you share the logcat of R52N20ALVDN
as GIST?
I couldnt attach file to GIST. Tried both docx and pdf. So attaching it here.
sorry, in this case, could you attach it as plain text?
I can't seem to paste the text. Any other way i can share the pdf file with you? My email address is [email protected]
Then, what about running two parallel sessions as https://github.com/appium/java-client/issues/1587#issuecomment-964726199 without the grid?
That is where I am confused. How do we run this without the grid and if parallel sessions can be run without the grid, then why do we have grid in the first place?
You can send the two capabilities to a single appium server. Appium server can handle multiple sessions. Or you can also run an appium server per session instead. This is to investigate the cause if the grid might be related.
I think you have decided to use a grid on your environment to manage your automation (mixed with selenium and appium?). I haven't used grid, so i have no good idea if the cause was grid specific. https://discuss.appium.io/ might help then to ask questions about grid.
Thank you for your help. I'll check this and let you know
@skhandekar1 Hello! I'm getting the same issue, were you able to resolve it?