WDIO can not click element for Android hybrid app - webdriver-io

I am new with App automation. I have a project with WDIO and Browserstack and start to automate a few e2e cases, but I have a problem with Andrid and WDIO. WDIO can not find my selectors and click them. I check all selectors with Appium Inspector and I am sure these are correct.
For the same app on IOS device, everything works correctly and seems that the problem is for an Android device.
This is a trace from VS code.
and after that, the code ends with Couldn't get element: welcomeCircleButton2 invalid session id: A session is either terminated or not started
webdriver: [POST] https://hub-cloud.browserstack.com/wd/hub/session/41a19c39a3c19fef04165b407866224902e2c49a/element
[0-0] 2022-05-01T12:36:08.747Z INFO webdriver: DATA { using: 'xpath', value: '//*[#content-desc="welcomeCircleButton2"]' }
[0-0] 2022-05-01T12:36:08.873Z INFO webdriver: RESULT {
[0-0] platform: 'LINUX',
[0-0] webStorageEnabled: false,
[0-0] takesScreenshot: true,
[0-0] javascriptEnabled: true,
[0-0] databaseEnabled: false,
[0-0] networkConnectionEnabled: true,
[0-0] locationContextEnabled: false,
[0-0] warnings: {},
[0-0] desired: {
[0-0] 'browserstack:options': {
[0-0] projectName: 'AppAuto',
[0-0] buildName: 'TestingMobile',
[0-0] local: true,
[0-0] debug: true
[0-0] },
[0-0] 'asda:capabType': 'browserstackmobileandroid',
[0-0] platformName: 'Android',
[0-0] 'bstack:options': { appiumVersion: '1.17.0' },
[0-0] 'goog:chromeOptions': {},
[0-0] newCommandTimeout: 0,
[0-0] deviceName: 'samsung galaxy s22',
[0-0] chromedriverPorts: [ [Array] ],
[0-0] automationName: 'uiautomator2',
[0-0] systemPort: 8205,
[0-0] chromedriverPort: 18085,
[0-0] skipServerInstallation: true,
[0-0] udid: 'R5CT11WJZZN',
[0-0] nativeWebScreenshot: true,
[0-0] disableSuppressAccessibilityService: true
[0-0] },
[0-0] 'browserstack:options': {
[0-0] projectName: 'AppAuto',
[0-0] buildName: 'TestingMobile',
[0-0] local: true,
[0-0] debug: true
[0-0] },
[0-0] 'asda:capabType': 'browserstackmobileandroid',
[0-0] platformName: 'Android',
[0-0] 'bstack:options': { appiumVersion: '1.17.0' },
[0-0] 'goog:chromeOptions': {},
[0-0] newCommandTimeout: 0,
[0-0] deviceName: 'R5CT11WJZZN',
[0-0] chromedriverPorts: [ [ 18155, 18165 ] ],
[0-0] automationName: 'uiautomator2',
[0-0] systemPort: 8205,
[0-0] chromedriverPort: 18085,
[0-0] skipServerInstallation: true,
[0-0] udid: 'R5CT11WJZZN',
[0-0] nativeWebScreenshot: true,
[0-0] disableSuppressAccessibilityService: true,
[0-0] deviceUDID: 'R5CT11WJZZN',
[0-0] deviceApiLevel: 31,
[0-0] platformVersion: '12',
[0-0] deviceScreenSize: '1080x2340',
[0-0] deviceScreenDensity: 480,
[0-0] deviceModel: 'SM-S901B',
[0-0] deviceManufacturer: 'samsung',
[0-0] pixelRatio: 3,
[0-0] statBarHeight: 79,
[0-0] viewportRect: { left: 0, top: 79, width: 1080, height: 2036 }
[0-0] }
I found this but again the same result - Appium+ WebdriverIO finding element issues
Is possible to have problems with WDIO and function findElement(selector)?

Related

appium XCUITest ios (React-native) app not launching

i have completed setup of appium automation testing and it is running fine in android, but when its came to ios from command line i run "yarn testios", test cases are started to checking but the app is not launching? why this happening and what is solution for that please guid me .....
i have mentioned setup files below
// this is "wdio.ios.config.js" file
exports.config = {
path: '/wd/hub/',
port: 4729,
services: ['appium'],
runner: 'local',
specs: [
'./test-ios/specs/**/*.js'
],
exclude: [
],
maxInstances: 1,
capabilities: [{
maxInstances: 1,
browserName: '',
appiumVersion: '1.22.0',
platformName: 'iOS',
platformVersion: '14.4',
deviceName: 'iPhone 11 Pro',
automationName: 'XCUITest',
acceptInsecureCerts: true,
appWaitDuration: 20000
}],
//app: '',
noReset: true,
// udid: '9084F2CE-E9B2-4632-B059-6506AA13A783',
udid: 'FF32131D-797C-447A-B67D-D5A244AC66DF',
autoLaunch: true,
bundleId: 'com.callboats',
logLevel: 'info',
bail: 0,
baseUrl: 'http://localhost',
waitforTimeout: 10000,
connectionRetryTimeout: 120000,
connectionRetryCount: 1,
services: ['appium'],
framework: 'mocha',
reporters: [['allure', {outputDir: 'allure-results'}],],
mochaOpts: {
ui: 'bdd',
timeout: 60000
},
afterTest: async function(test, context, { error, result, duration, passed, retries }) {
if (!passed) {
await browser.takeScreenshot();
}
},
}
// this is package.json file
{
"name": "testing_appium",
"version": "1.0.0",
"description": "automated testing with appium",
"main": "index.js",
"scripts": {
"testandroid": "npx wdio ./wdio.android.conf.js",
"testios": "npx wdio ./wdio.ios.conf.js"
},
"author": "TatvaSoft",
"license": "ISC",
"dependencies": {
"#wdio/cli": "^7.16.10",
"appium": "^1.22.1",
"asyncbox": "^2.9.2",
"chai": "^4.3.4",
"webdriverio": "^7.16.10"
},
"devDependencies": {
"#wdio/allure-reporter": "^7.16.10",
"#wdio/appium-service": "^7.16.6",
"#wdio/local-runner": "^7.16.10",
"#wdio/mocha-framework": "^7.16.6",
"wdio-mochawesome-reporter": "^4.0.0"
}
}
// here is logs of terminal
pcq214#PCQ214 testing_appium %
pcq214#PCQ214 testing_appium % yarn testios
yarn run v1.22.10
warning ../../../../../../package.json: No license field
$ npx wdio ./wdio.ios.conf.js
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist#latest --update-db
Why you should do it regularly:
https://github.com/browserslist/browserslist#browsers-data-updating
Execution of 1 workers started at 2021-12-17T09:37:28.281Z
2021-12-17T09:37:28.722Z INFO #wdio/cli:launcher: Run onPrepare hook
2021-12-17T09:37:41.615Z INFO #wdio/cli:launcher: Run onWorkerStart hook
2021-12-17T09:37:41.616Z INFO #wdio/local-runner: Start worker 0-0 with arg: ./wdio.ios.conf.js
[0-0] 2021-12-17T09:37:44.352Z INFO #wdio/local-runner: Run worker command: run
[0-0] Browserslist: caniuse-lite is outdated. Please run:
[0-0] npx browserslist#latest --update-db
[0-0]
[0-0] Why you should do it regularly:
[0-0] https://github.com/browserslist/browserslist#browsers-data-updating
[0-0] RUNNING in iOS - /test-ios/specs/example.e2e.js
[0-0] 2021-12-17T09:37:49.187Z INFO webdriver: Initiate new session using the WebDriver protocol
[0-0] 2021-12-17T09:37:50.505Z INFO webdriver: [POST] http://localhost:4723/session
[0-0] 2021-12-17T09:37:50.505Z INFO webdriver: DATA {
[0-0] capabilities: {
[0-0] alwaysMatch: {
[0-0] browserName: '',
[0-0] appiumVersion: '1.22.0',
[0-0] platformName: 'iOS',
[0-0] platformVersion: '14.4',
[0-0] deviceName: 'iPhone 11 Pro',
[0-0] automationName: 'XCUITest',
[0-0] acceptInsecureCerts: true,
[0-0] appWaitDuration: 20000
[0-0] },
[0-0] firstMatch: [ {} ]
[0-0] },
[0-0] desiredCapabilities: {
[0-0] browserName: '',
[0-0] appiumVersion: '1.22.0',
[0-0] platformName: 'iOS',
[0-0] platformVersion: '14.4',
[0-0] deviceName: 'iPhone 11 Pro',
[0-0] automationName: 'XCUITest',
[0-0] acceptInsecureCerts: true,
[0-0] appWaitDuration: 20000
[0-0] }
[0-0] }
[0-0] 2021-12-17T09:38:10.129Z INFO webdriver: COMMAND launchApp()
[0-0] 2021-12-17T09:38:10.129Z INFO webdriver: [POST] http://localhost:4723/session/5539814a-78ef-407d-935f-496b39f32403/appium/app/launch
[0-0] 2021-12-17T09:38:13.141Z INFO webdriver: COMMAND findElement("accessibility id", "settings-btn")
[0-0] 2021-12-17T09:38:13.141Z INFO webdriver: [POST] http://localhost:4723/session/5539814a-78ef-407d-935f-496b39f32403/element
[0-0] 2021-12-17T09:38:13.141Z INFO webdriver: DATA { using: 'accessibility id', value: 'settings-btn' }
[0-0] 2021-12-17T09:38:14.133Z INFO webdriver: RESULT {
[0-0] error: 'no such element',
[0-0] message: 'An element could not be located on the page using the given search parameters.',
[0-0] stacktrace: 'NoSuchElementError: An element could not be located on the page using the given search parameters.\n' +
[0-0] ' at XCUITestDriver.doNativeFind (/Users/pcq214/Desktop/react-native/testing/callboats-mobile-app/app-client-mobile/testing_appium/node_modules/appium-xcuitest-driver/lib/commands/find.js:130:11)\n' +
[0-0] ' at processTicksAndRejections (internal/process/task_queues.js:93:5)\n' +
[0-0] ' at XCUITestDriver.findNativeElementOrElements (/Users/pcq214/Desktop/react-native/testing/callboats-mobile-app/app-client-mobile/testing_appium/node_modules/appium-xcuitest-driver/lib/commands/find.js:90:10)\n' +
[0-0] ' at XCUITestDriver.findElOrEls (/Users/pcq214/Desktop/react-native/testing/callboats-mobile-app/app-client-mobile/testing_appium/node_modules/appium-xcuitest-driver/lib/commands/find.js:23:12)\n' +
[0-0] ' at XCUITestDriver.findElOrElsWithProcessing (/Users/pcq214/Desktop/react-native/testing/callboats-mobile-app/app-client-mobile/testing_appium/node_modules/appium-base-driver/lib/basedriver/commands/find.js:33:12)\n' +
[0-0] ' at XCUITestDriver.findElement (/Users/pcq214/Desktop/react-native/testing/callboats-mobile-app/app-client-mobile/testing_appium/node_modules/appium-base-driver/lib/basedriver/commands/find.js:53:10)'
[0-0] }
[0-0] 2021-12-17T09:38:14.405Z INFO webdriver: COMMAND findElement("accessibility id", "settings-btn")
[0-0] 2021-12-17T09:38:14.405Z INFO webdriver: [POST] http://localhost:4723/session/5539814a-78ef-407d-935f-496b39f32403/element
[0-0] 2021-12-17T09:38:14.405Z INFO webdriver: DATA { using: 'accessibility id', value: 'settings-btn' }
[0-0] 2021-12-17T09:38:14.566Z INFO webdriver: RESULT {
[0-0] error: 'no such element',
[0-0] message: 'An element could not be located on the page using the given search parameters.',
[0-0] stacktrace: 'NoSuchElementError: An element could not be located on the page using the given search parameters.\n' +
[0-0] ' at XCUITestDriver.doNativeFind (/Users/pcq214/Desktop/react-native/testing/callboats-mobile-app/app-client-mobile/testing_appium/node_modules/appium-xcuitest-driver/lib/commands/find.js:130:11)\n' +
[0-0] ' at processTicksAndRejections (internal/process/task_queues.js:93:5)\n' +
[0-0] ' at XCUITestDriver.findNativeElementOrElements (/Users/pcq214/Desktop/react-native/testing/callboats-mobile-app/app-client-mobile/testing_appium/node_modules/appium-xcuitest-driver/lib/commands/find.js:90:10)\n' +
[0-0] ' at XCUITestDriver.findElOrEls (/Users/pcq214/Desktop/react-native/testing/callboats-mobile-app/app-client-mobile/testing_appium/node_modules/appium-xcuitest-driver/lib/commands/find.js:23:12)\n' +
[0-0] ' at XCUITestDriver.findElOrElsWithProcessing (/Users/pcq214/Desktop/react-native/testing/callboats-mobile-app/app-client-mobile/testing_appium/node_modules/appium-base-driver/lib/basedriver/commands/find.js:33:12)\n' +
[0-0] ' at XCUITestDriver.findElement (/Users/pcq214/Desktop/react-native/testing/callboats-mobile-app/app-client-mobile/testing_appium/node_modules/appium-base-driver/lib/basedriver/commands/find.js:53:10)'
[0-0] }
[0-0] 2021-12-17T09:38:14.889Z INFO webdriver: COMMAND findElement("accessibility id", "settings-btn")
[0-0] 2021-12-17T09:38:14.890Z INFO webdriver: [POST] http://localhost:4723/session/5539814a-78ef-407d-935f-496b39f32403/element
[0-0] 2021-12-17T09:38:14.890Z INFO webdriver: DATA { using: 'accessibility id', value: 'settings-btn' }
[0-0] 2021-12-17T09:38:15.019Z INFO webdriver: RESULT {
[0-0] error: 'no such element',
[0-0] message: 'An element could not be located on the page using the given search parameters.',
[0-0] stacktrace: 'NoSuchElementError: An element could not be located on the page using the given search parameters.\n' +
[0-0] ' at XCUITestDriver.doNativeFind (/Users/pcq214/Desktop/react-native/testing/callboats-mobile-app/app-client-mobile/testing_appium/node_modules/appium-xcuitest-driver/lib/commands/find.js:130:11)\n' +
[0-0] ' at processTicksAndRejections (internal/process/task_queues.js:93:5)\n' +
[0-0] ' at XCUITestDriver.findNativeElementOrElements (/Users/pcq214/Desktop/react-native/testing/callboats-mobile-app/app-client-mobile/testing_appium/node_modules/appium-xcuitest-driver/lib/commands/find.js:90:10)\n' +
[0-0] ' at XCUITestDriver.findElOrEls (/Users/pcq214/Desktop/react-native/testing/callboats-mobile-app/app-client-mobile/testing_appium/node_modules/appium-xcuitest-driver/lib/commands/find.js:23:12)\n' +
[0-0] ' at XCUITestDriver.findElOrElsWithProcessing (/Users/pcq214/Desktop/react-native/testing/callboats-mobile-app/app-client-mobile/testing_appium/node_modules/appium-base-driver/lib/basedriver/commands/find.js:33:12)\n' +
[0-0] ' at XCUITestDriver.findElement (/Users/pcq214/Desktop/react-native/testing/callboats-mobile-app/app-client-mobile/testing_appium/node_modules/appium-base-driver/lib/basedriver/commands/find.js:53:10)'
[0-0] }
[0-0] 2021-12-17T09:38:15.172Z INFO webdriver: COMMAND findElement("accessibility id", "settings-btn")
[0-0] 2021-12-17T09:38:15.173Z INFO webdriver: [POST] http://localhost:4723/session/5539814a-78ef-407d-935f-496b39f32403/element
[0-0] 2021-12-17T09:38:15.173Z INFO webdriver: DATA { using: 'accessibility id', value: 'settings-btn' }
^C
Ending WebDriver sessions gracefully ...
(press ctrl+c again to hard kill the runner)
2021-12-17T09:38:15.204Z INFO #wdio/local-runner: Shutting down spawned worker
[0-0] 2021-12-17T09:38:15.204Z INFO #wdio/local-runner: Received SIGINT, giving process 5000ms to shutdown gracefully
[0-0] 2021-12-17T09:38:15.206Z INFO #wdio/local-runner: Run worker command: endSession
[0-0] 2021-12-17T09:38:15.206Z INFO webdriver: COMMAND deleteSession()
[0-0] 2021-12-17T09:38:15.206Z INFO webdriver: [DELETE] http://localhost:4723/session/5539814a-78ef-407d-935f-496b39f32403
//continue...........................................and fail cases because app is not launching
//here is starting of my test cases.....in "example.e2e.js"
// it will launch the application
describe('launch the app', ()=>{
before(()=>{
it("should launch the app", async ()=>{
let driver = await initSession();
//let driver = new AndroidDriver();
//await driver.launchApp('com.callboats');
//await driver.activateApp('com.callboats');
await driver.execute('mobile: launchApp');
await $("~map-view").waitForDisplayed(20000, false)
})
})
});
//it will check the flow of trip as anonymous user
describe('testing enjoy trip as anonymous user', ()=> {
it('should render mapView', async ()=>{
await driver.launchApp();
await browser.waitUntil(
async () => (await $("~settings-btn").isDisplayed()) == true,
{
timeout: 50000,
timeoutMsg: 'id(settings-btn) is not displayed'
}
);
await browser.waitUntil(
async () => (await $("~map-view").isDisplayed()) == true,
{
timeout: 50000,
timeoutMsg: 'id(map-view) is not displayed'
}
);
await browser.waitUntil(
async () => (await $("~main-mapview").isDisplayed()) == true,
{
timeout: 50000,
timeoutMsg: 'id(main-mapview) is not displayed'
}
);
}).....................continue
You are missing the bundleId value in your capabilities to launch the app.
capabilities: [{
maxInstances: 1,
browserName: '',
appiumVersion: '1.22.0',
platformName: 'iOS',
platformVersion: '14.4',
deviceName: 'iPhone 11 Pro',
automationName: 'XCUITest',
acceptInsecureCerts: true,
appWaitDuration: 20000,
*bundleId*: {value}
}],
Here is a reference on how to obtain the bundleId value

safaridriver: unrecognized option '--w3c'

I'm trying to run a test against safari running on an iPhone in BrowserStack. Using nightwatch test framework. When I launch the runner from my IDE(IntelliJ), I see this error:
/usr/local/bin/node /Users/mike/IdeaProjects/company_front_end/node_modules/nightwatch/bin/runner.js
Error: SafariDriver process exited with code: 1
safaridriver: unrecognized option `--w3c'
at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
safaridriver: unrecognized option `--w3c'
Process finished with exit code 10
nightwatch.conf.js:
nightwatch_config = {
selenium : {
"start_process" : false,
"host" : "hub-cloud.browserstack.com",
"port" : 80
},
webdriver: {
start_process: false,
port: 4444,
server_path: '/usr/bin/safaridriver',
cli_args: [
// very verbose geckodriver logs
'-vv'
]
},
test_settings: {
default: {
launch_url: 'https://mariner.dev.yembo.ai',
desiredCapabilities : {
browserName : 'safari',
'browserstack.user': 'user',
'browserstack.key': 'key',
platformName: 'iOS',
device: 'iPhone X',
realMobile: true,
acceptSslCerts: true,
//'browser': 'chrome',
'name': 'Bstack-[Nightwatch] Sample Test',
alwaysMatch: {
// Enable this if you encounter unexpected SSL certificate errors in Firefox
// acceptInsecureCerts: true,
'moz:firefoxOptions': {
args: [
// '-headless',
// '-verbose'
],
}
}
}
}
}
};
// Code to copy seleniumhost/port into test settings
for(var i in nightwatch_config.test_settings){
var config = nightwatch_config.test_settings[i];
config['selenium_host'] = nightwatch_config.selenium.host;
config['selenium_port'] = nightwatch_config.selenium.port;
}
module.exports = nightwatch_config;
I can certainly post more info if needed, but will start here in case this is a common setup error, as I am unfamiliar with front-end automation.
It seems you are adding the W3C protocol somewhere in your config, could you share the capability set here? You may try running a sample test from here: https://github.com/browserstack/nightwatch-browserstack

Webdriver.io - can not get firefox to run

I am trying to get firefox to run in webdriver.io 5. This is on a Linux cloud.
I get:
2020-02-28T02:32:33.472Z INFO #wdio/cli:launcher: Run onPrepare hook
2020-02-28T02:32:33.475Z INFO #wdio/local-runner: Start worker 0-0 with arg: wdio.conf.js
[0-0] 2020-02-28T02:32:33.818Z INFO #wdio/local-runner: Run worker command: run
[0-0] RUNNING in firefox - /build/main.js
[0-0] 2020-02-28T02:32:33.881Z INFO webdriverio: Initiate new session using the webdriver protocol
[0-0] 2020-02-28T02:32:33.883Z INFO webdriver: [POST] http://127.0.0.1:4444/session
[0-0] 2020-02-28T02:32:33.883Z INFO webdriver: DATA {
capabilities: {
alwaysMatch: { browserName: 'firefox', 'moz:firefoxOptions': [Object] },
firstMatch: [ {} ]
},
desiredCapabilities: { browserName: 'firefox', 'moz:firefoxOptions': { args: [Array] } }
}
[0-0] 2020-02-28T02:32:33.899Z WARN webdriver: Request failed due to connect ECONNREFUSED 127.0.0.1:4444
[0-0] 2020-02-28T02:32:33.899Z INFO webdriver: Retrying 1/3
Here is my config:
exports.config = {
runner: 'local',
path: '/',
specs: [
'./build/**/*.js'
],
maxInstances: 10,
capabilities: [
{
"browserName": "firefox",
"moz:firefoxOptions": {
"args": ["-headless"],
}
}
],
logLevel: 'info',
bail: 0,
baseUrl: 'http://localhost',
waitforTimeout: 10000,
connectionRetryTimeout: 90000,
connectionRetryCount: 3,
reporters: ['spec'],
framework: 'mocha',
mochaOpts: {
ui: 'bdd',
timeout: 60000
},
services: [
],
}```
Any ideas what I am doing wrong?
The path should be set to path: "/wd/hub" and your services seems to be empty. You can use webdriverio with mocha in two different ways. With selenium or without.
Please refer to boiler plates from official docs here
[0-0] 2020-02-28T02:32:33.899Z WARN webdriver: Request failed due to connect ECONNREFUSED 127.0.0.1:4444
If you are using selenium-standalone, please make sure that you have both the java jdk & sdk installed on your machine. let me know if this worked for you.

Running tests on browserstack throws "Cannot read property 'capabilities' of null"

I am running tests using wdioV5 and browserstack but I am getting the following error:
ERROR #wdio/local-runner: Failed launching test session: TypeError: Cannot read property 'capabilities' of null
I tried to check the debug logs but unable to figure the reasoning behind it, has anyone faced a similar issue?
DEBUG output:
[0-0] 2019-06-06T13:34:00.454Z INFO webdriver: Retrying 3/3
[0-0] 2019-06-06T13:34:00.455Z INFO webdriver: [POST] https://hub-cloud.browserstack.com:443/session
[0-0] 2019-06-06T13:34:00.455Z INFO webdriver: DATA { capabilities:
{ alwaysMatch:
{ os: 'Windows',
os_version: '10',
browser: 'Chrome',
browser_version: '73.0',
'browserstack.local': true },
firstMatch: [ {} ] },
desiredCapabilities:
{ os: 'Windows',
os_version: '10',
browser: 'Chrome',
browser_version: '73.0',
'browserstack.local': true } }
[0-0] 2019-06-06T13:34:00.480Z DEBUG webdriver: request failed due to status 13
[0-0] 2019-06-06T13:34:00.481Z ERROR webdriver: Request failed due to Error: Session not started or terminated
If it helps reproduce, my config is:
path: '/',
specs: [ './specs/**/*.js' ],
exclude: [],
maxInstances: 10,
capabilities:
[ { os: 'Windows',
os_version: '10',
browser: 'Chrome',
browser_version: '73.0' } ],
logLevel: 'trace',
bail: 0,
baseUrl: 'http://localhost:8000',
waitforTimeout: 10000,
connectionRetryTimeout: 90000,
connectionRetryCount: 3,
services: [ 'browserstack' ],
framework: 'mocha',
reporters: [ 'spec' ],
mochaOpts: { timeout: 60000 },
before: [Function: before],
user: 'xxx',
key: 'xxx',
browserstackLocal: true,
onPrepare: [Function: onPrepare],
onComplete: [Function: onComplete] }
Figured it out... for some reason, having this option in the wdio.conf.js threw the error message above, the moment I removed it, it worked, which is mad:
path: '/'

Webdriver cannot connect to Selenium server

I am currently trying to set up webdriver and selenium together to run my automation tests through docker but am facing issues. Each time i try to run the tests I get the following error ERROR wdio-runner: Error: connect ECONNREFUSED 127.0.0.1:4444
I am using the selenium/standalone-chrome from docker and can see that the server is configured correctly and running at 127.0.0.1:4444 as I can hit it.
When I try to run webdriver however I seem to face the issue mentioned above. I believe the issue must be something in my webdriver config but having followed the documentation I can't see what's wrong...
const chai = require('chai');
const chaiWebdriver = require('chai-webdriverio').default;
const debug = process.env.DEBUG;
exports.config = {
runner: 'local',
host: '127.0.0.1',
port: 4444,
path: '/wd/hub',
specs: ['specs/**/*.js'],
suites: {
smoke: ['specs/smoke-spec.js']
},
maxInstances: 10,
capabilities: {
browserName: 'chrome',
'goog:chromeOptions': {}
},
sync: true,
logLevel: 'error',
coloredLogs: true,
deprecationWarnings: false,
bail: 0,
debug,
execArgv: debug ? ['--inspect'] : [],
screenshotOnReject: true,
screenshotPath: './error-screenshots',
baseUrl: https://localhost:443,
waitforTimeout: 30000,
connectionRetryTimeout: 90000,
connectionRetryCount: 3,
seleniumLogs: './selenium-logs',
framework: 'mocha',
reporters: [
[
'allure',
{
outputDir: 'test-output',
disableWebdriverStepsReporting: true,
disableWebdriverScreenshotsReporting: false
}
],
['spec', {}]
],
mochaOpts: {
ui: 'bdd',
timeout: 400000,
compilers: ['js:babel-register']
},
before() {
chai.use(chaiWebdriver(browser));
global.expect = chai.expect;
},
afterTest: test => {
if (!test.passed) {
browser.takeScreenshot();
}
}
};