I ran Flutter mobile automation on Wdio, but it got an error: Unable to connect to “http://localhost:4723/wd/hub”, make sure the browser driver is running on that address.
this is my wdio.conf
exports.config = {
runner: ‘local’,
path: ‘/wd/hub’,
port: 4723,
specs: [
‘./test/specs/**/*.js’
],
exclude: [
],
maxInstances: 10,
capabilities: [{
platformName: ‘IOS’,
‘appium:platformVersion’: ‘15.0’,
‘appium:deviceName’: ‘iPhone 14 Pro’,
‘appium:Reset’: false,
‘appium:automationName’: ‘Flutter’,
‘appium:app’: ”,
}],
logLevel: ‘info’,
bail: 0,
waitforTimeout: 10000,
connectionRetryTimeout: 120000,
connectionRetryCount: 3,
framework: ‘mocha’,
mochaOpts: {
ui: ‘bdd’,
timeout: 60000
},
}
i ttry to uninstall appium and reinstall, but still error like this
[0-0] }
[0-0] }
[0-0] 2024-12-09T05:46:13.716Z ERROR webdriver: WebDriverError: Request failed with error code ECONNREFUSED when running “http://localhost:4723/wd/hub/session” with method “POST” and args “{“capabilities”:{“alwaysMatch”:{“platformName”:”Android”,”appium:platformVersion”:”15.0″,”appium:deviceName”:”emulator-5554″,”appium:Reset”:false,”appium:automationName”:”Flutter”,”appium:app”:”/Users/ms/Documents/app-dev-debug.apk”},”firstMatch”:[{}]}}”
[0-0] 2024-12-09T05:46:13.716Z ERROR webdriver: Error: WebDriverError: Request failed with error code ECONNREFUSED when running “http://localhost:4723/wd/hub/session” with method “POST” and args “{“capabilities”:{“alwaysMatch”:{“platformName”:”Android”,”appium:platformVersion”:”15.0″,”appium:deviceName”:”emulator-5554″,”appium:Reset”:false,”appium:automationName”:”Flutter”,”appium:app”:”/Users/ms/Documents/app-dev-debug.apk”},”firstMatch”:[{}]}}”
[0-0] at FetchRequest._libRequest (file:///Users/ms/Documents/repeository/Latihan/ANDORID_AUTOMATION/node_modules/webdriver/build/node.js:1607:13)
[0-0] at processTicksAndRejections (node:internal/process/task_queues:95:5)
[0-0] at FetchRequest._request (file:///Users/ms/Documents/repeository/Latihan/ANDORID_AUTOMATION/node_modules/webdriver/build/node.js:1617:20)
[0-0] at startWebDriverSession (file:///Users/ms/Documents/repeository/Latihan/ANDORID_AUTOMATION/node_modules/webdriver/build/node.js:1022:16)
[0-0] at Function.newSession (file:///Users/ms/Documents/repeository/Latihan/ANDORID_AUTOMATION/node_modules/webdriver/build/node.js:1238:41)
[0-0] at remote (file:///Users/ms/Documents/repeository/Latihan/ANDORID_AUTOMATION/node_modules/webdriverio/build/index.js:7810:20)
[0-0] at Runner._startSession (file:///Users/ms/Documents/repeository/Latihan/ANDORID_AUTOMATION/node_modules/@wdio/runner/build/index.js:791:23)
[0-0] at Runner._initSession (file:///Users/ms/Documents/repeository/Latihan/ANDORID_AUTOMATION/node_modules/@wdio/runner/build/index.js:765:22)
[0-0] at Runner.run (file:///Users/ms/Documents/repeository/Latihan/ANDORID_AUTOMATION/node_modules/@wdio/runner/build/index.js:672:16)
[0-0] 2024-12-09T05:46:13.722Z ERROR @wdio/runner: Error: Failed to create session.
[0-0] Unable to connect to “http://localhost:4723/wd/hub”, make sure browser driver is running on that address.
[0-0] It seems like the service failed to start or is rejecting any connections.
[0-0] at startWebDriverSession (file:///Users/ms/Documents/repeository/Latihan/ANDORID_AUTOMATION/node_modules/webdriver/build/node.js:1026:11)
[0-0] at processTicksAndRejections (node:internal/process/task_queues:95:5)
[0-0] at Function.newSession (file:///Users/ms/Documents/repeository/Latihan/ANDORID_AUTOMATION/node_modules/webdriver/build/node.js:1238:41)
[0-0] at remote (file:///Users/ms/Documents/repeository/Latihan/ANDORID_AUTOMATION/node_modules/webdriverio/build/index.js:7810:20)
[0-0] at Runner._startSession (file:///Users/ms/Documents/repeository/Latihan/ANDORID_AUTOMATION/node_modules/@wdio/runner/build/index.js:791:23)
[0-0] at Runner._initSession (file:///Users/ms/Documents/repeository/Latihan/ANDORID_AUTOMATION/node_modules/@wdio/runner/build/index.js:765:22)
[0-0] at Runner.run (file:///Users/ms/Documents/repeository/Latihan/ANDORID_AUTOMATION/node_modules/@wdio/runner/build/index.js:672:16)
[0-0] FAILED in Android – file:///test/specs/test.e2e.js
2024-12-09T05:46:13.866Z INFO @wdio/cli:launcher: Run onWorkerEnd hook
2024-12-09T05:46:13.867Z INFO @wdio/cli:launcher: Run onComplete hook
Spec Files: 0 passed, 1 failed, 1 total (100% completed) in 00:00:08