Skip to content

Instantly share code, notes, and snippets.

@TuHuynhVan
Created December 10, 2021 15:47
Show Gist options
  • Save TuHuynhVan/44854de2646c569a35525eebbc476588 to your computer and use it in GitHub Desktop.
Save TuHuynhVan/44854de2646c569a35525eebbc476588 to your computer and use it in GitHub Desktop.
## Download
* https://www.selenium.dev/downloads/ | Previous Version | Server standalone 3.141.59
* Custom Matcher | https://github.com/TuHuynhVan/custom-matcher-selenium-grid-with-appium/tree/master/3.149.build
## Hub config | hubConfig.json
```
{
"host": "192.168.1.202",
"port": 4444,
"newSessionWaitTimeout": 60,
"servlets": [],
"withoutServlets": [],
"custom": {},
"capabilityMatcher": "com.sdetpro.appium.grid.matcher.CustomCapabilityMatcher",
"registry": "org.openqa.grid.internal.DefaultGridRegistry",
"throwOnCapabilityNotPresent": true,
"cleanUpCycle": 5000,
"role": "hub",
"debug": false,
"browserTimeout": 0,
"timeout": 90,
"sessionTimeout": 90
}
```
## Node 01 config | node_6000_config.json | Please replace the UDID
```
{
"capabilities": [
{
"version": "9",
"maxInstances": 1,
"platform": "ANDROID",
"deviceName": "Samsung J7",
"udid": "3300d3672cca62b9"
}
],
"configuration": {
"cleanUpCycle": 2000,
"timeout": 30000,
"proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
"url": "http://192.168.1.202:6000/wd/hub",
"host": "192.168.1.202",
"port": 6000,
"maxSession": 1,
"register": true,
"registerCycle": 5000,
"hubPort": 4444,
"hubHost": "192.168.1.202",
"hubProtocol": "http"
}
}
```
## Node 02 config | node_7000_config.json | Please replace the UDID
```
{
"capabilities": [
{
"version": "9",
"maxInstances": 1,
"platform": "ANDROID",
"deviceName": "Samsung J7",
"udid": "emulator-5554"
}
],
"configuration": {
"cleanUpCycle": 2000,
"timeout": 30000,
"proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
"url": "http://192.168.1.202:7000/wd/hub",
"host": "192.168.1.202",
"port": 7000,
"maxSession": 1,
"register": true,
"registerCycle": 5000,
"hubPort": 4444,
"hubHost": "192.168.1.202",
"hubProtocol": "http"
}
}
```
## Commands
### Start HUB
```
java -cp selenium-server-standalone-3.141.59.jar:selenium-grid-custom-matcher-3.141.59.jar org.openqa.grid.selenium.GridLauncherV3 -role hub -hubConfig hubConfig.json
```
### Start Node 01
```
appium -p 6000 --nodeconfig node_6000_config.json
```
### Start Node 02
```
appium -p 7000 --nodeconfig node_7000_config.json
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment