I have setup the NightwatchJS project with wikipedia sample app. I tried to run that on appium + android adv and it works fine. Then I tried to create selenium grid with hub and node setup and used following config,
# appium-android.yml
server:
port: 4723
use-drivers:
- uiautomator2
default-capabilities:
appium:wdaLocalPort: 8100
appium:mjpegServerPort: 9100
appium:mjpegScreenshotUrl: "http://localhost:9100"
# node.toml
[server]
port = 5555
[node]
detect-drivers = false
[relay]
url = "http://localhost:4723"
status-endpoint = "/status"
protocol-version = "HTTP/1.1"
configs = [
"1", "{"platformName": "Android", "appium:platformVersion": "11.0", "appium:deviceName": "nightwatch-android-11", "appium:automationName": "uiautomator2"}"
]
ref: https://appium.io/docs/en/2.0/guides/grid/
After that I changed the config as mention below and was trying to use --env app.android.emulator
but each time it gets stuck on Connecting to localhost on port 4444...
module.exports = {
...
test_settings: {
default: {
disable_error_log: false,
launch_url: 'http://localhost',
screenshots: {
enabled: false,
path: 'screens',
on_failure: true
},
desiredCapabilities: {
browserName: 'chrome'
},
webdriver: {
start_process: true,
server_path: ''
},
},
app: {
selenium: {
start_process: true,
use_appium: true,
host: 'http://localhost',
port: 4444,
server_path: '',
cli_args: [],
default_path_prefix: ''
},
webdriver: {
timeout_options: {
timeout: 150000,
retry_attempts: 3
},
keep_alive: false,
start_process: false
}
},
'app.android.emulator': {
extends: 'app',
'desiredCapabilities': {
browserName: null,
platformName: 'android',
'appium:options': {
automationName: 'UiAutomator2',
app: `${__dirname}/nightwatch/sample-apps/wikipedia.apk`,
appPackage: 'org.wikipedia',
appActivity: 'org.wikipedia.main.MainActivity',
appWaitActivity: 'org.wikipedia.onboarding.InitialOnboardingActivity',
chromedriverExecutable: `${__dirname}/chromedriver-mobile/chromedriver.exe`,
newCommandTimeout: 0
}
}
},
selenium_server: {
selenium: {
start_process: false,
host: 'http://localhost',
port: 4444
}
},
'selenium.desktop.chrome': {
extends: 'selenium_server',
desiredCapabilities: {
browserName: 'chrome',
chromeOptions : {
w3c: true
}
}
},
'selenium.android.chrome': {
extends: 'selenium_server',
selenium: {
start_process: false
},
desiredCapabilities: {
real_mobile: false,
browserName: 'chrome',
'goog:chromeOptions': {
w3c: true,
args: [],
androidPackage: 'com.android.chrome',
},
},
webdriver: {
start_process: true,
server_path: 'chromedriver-mobile/chromedriver.exe',
cli_args: [
// --verbose
]
}
},
}
};
New contributor
Yash Sorath is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.