appium: Unable to pool the devices on selenium grid
The problem
I am unable to pool the devices on selenium grid for parallel testing. I have 2 real mobile devices connected to my grid and i want the grid to pick a device based on availablity. I do not want to always run on a particular device so I do not want to provide deviceName capability and i am using cucumber to run my tests so parallel testing is possible when the tests instances are tiggered from multiple sources (like different machines same time).
I want this setup to be working in gitlab pipelines for branches where multiple test instances are triggered with code changes and they could be parallel.
Node 1:
maxSession: 1
capabilities: Capabilities {browserName: Chrome, deviceName: ad0717021c344ef24b, maxInstances: 1, platform: ANDROID, platformName: Android, seleniumProtocol: WebDriver, server:CONFIG_UUID: bf2dc302-da0c-4361-a186-5c0..., version: 9.1}
Node 2
maxSession: 1
capabilities: Capabilities {browserName: Chrome, deviceName: V3XDU18129002649, maxInstances: 1, platform: ANDROID, platformName: Android, seleniumProtocol: WebDriver, server:CONFIG_UUID: b832a0de-43c8-4101-9e63-91c..., version: 9.1}
Commands to launch appium nodes
- appium --session-override --nodeconfig path/nodeconfig1.json -p 4728 --bootstrap-port 2255
- appium --session-override --nodeconfig path/nodeconfig2.json -p 4729 --bootstrap-port 2256
Environment
Appium - 1.10.1 selenium - 3.141.59
Link to Appium logs
1) Error in custom provider, org.openqa.selenium.SessionNotCreatedException: A new session could not be created. Details: The desiredCapabilities object was not valid for the following reason(s): 'deviceName' can't be blank
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'mahesh-thuma', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '4.15.0-48-generic', java.version: '1.8.0_181'
Driver info: driver.version: RemoteWebDriver
remote stacktrace: SessionNotCreatedError: A new session could not be created. Details: The desiredCapabilities object was not valid for the following reason(s): 'deviceName' can't be blank
Code To Reproduce Issue
private fun getAndroidDriver(grid_url: String): RemoteWebDriver{
val caps = DesiredCapabilities()
caps.setCapability("platform", "Android")
caps.setCapability("platformName", "Android")
caps.setCapability("deviceName","")
caps.setCapability("browserName","Chrome")
caps.setCapability("automationName","UiAutomator")
return RemoteWebDriver(java.net.URL(grid_url), caps)
}
About this issue
- Original URL
- State: open
- Created 5 years ago
- Comments: 19 (1 by maintainers)
@mykola-mokhnach thanks for the reference @juandg Thanks for your solution i got it work and i can now run parallel tests on my available devices