-
Notifications
You must be signed in to change notification settings - Fork 56
browserstack-local does not work with webdriverio v5 but works with webdriverio v4 #85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Can somebody confirm this? |
I just tried the BrowserStack sample Webdriver IO to test this out- https://github.com/browserstack/webdriverio-browserstack. The sample test with Local enabled works. |
@abhi291096 I have tried to execute sample test but it was not successful. |
@suchitrak I'm able to get BS working with Webdriverio V5. You might have to include the <"browserstack.local" : true> option in your capabilities |
Hello, I have somehow the same issue. We are using WebdriverIo v5 and browserstack, it works fine locally and on browserstack but we are recently trying to use We have a function that connects to browserstack-local
We created a dedicated function to create the client for mulit-remote
|
From the exception logs generated, I see that the exception ECONNREFUSED is generated as the file contains code to localhost (127.0.0.1:4444).
Could you please check the same at your end and ensure that the REQUESTS are to the host:
in the Webdriver IO conf.js files? You can refer the BrowserStack sample conf file in then link:https://github.com/browserstack/webdriverio-browserstack/blob/master/conf/single.conf.js |
hello @abhi291096 , This is the function we use to generate our capabilities
As we use 'browserstack.local': true, I thought it was not necessary to specify the host. We have it working fine with browserstack when using |
Hey, I would recommend you to try executing a test by specifying the host parameter as shared previously and share the corresponding results:
You can refer to a sample conf file in the link: https://github.com/browserstack/webdriverio-browserstack/blob/master/conf/single.conf.js |
Hi @abhi291096 , let me try again by adding the |
hello @abhi291096, I tried again this what I got as a result
|
browserstack-local does not work with webdriverio V5 but works with V4 in mutiremote(https://webdriver.io/docs/multiremote.html) capability
wdio.conf.js
var browserstack = require('browserstack-local');
exports.config = {
user:'',
key: '',
},
onComplete: function (exitCode, config, capabilities,results) {
exports.bs_local.stop({function () { console.log("bslocal stopped") }});
},
capabilities: {
myChromeBrowser: {
capabilities: {
browserName: 'chrome'
}
},
myFirefoxBrowser: {
capabilities: {
browserName: 'firefox'
}
}
},
logLevel: 'info',
bail: 0,
baseUrl: '',
waitforTimeout: 10000,
connectionRetryTimeout: 90000,
connectionRetryCount: 3,
services: ['browserstack'],
framework: 'mocha',
reporters: ['spec'],
mochaOpts: {
ui: 'bdd',
timeout: 60000
}
}
Basic.js
const assert = require('assert')
describe('webdriver.io page', () => {
it('should have the right title', () => {
myChromeBrowser.url('https://webdriver.io')
myFirefoxBrowser.url('https://google.com')
const title = browser.getTitle()
assert.strictEqual(title, 'WebdriverIO · Next-gen WebDriver test framework for Node.js')
})
})
package.json
{
"name": "browserstack",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo "Error: no test specified" && exit 1"
},
"author": "",
"license": "ISC",
"devDependencies": {
"@wdio/browserstack-service": "^5.12.5",
"@wdio/cli": "^5.13.1",
"@wdio/local-runner": "^5.13.1",
"@wdio/mocha-framework": "^5.12.1",
"@wdio/spec-reporter": "^5.12.1",
"@wdio/sync": "^5.13.0",
"browserstack-local": "^1.4.2",
"chromedriver": "^77.0.0",
"wdio-chromedriver-service": "^5.0.2"
}
}
Gives Error - ERROR: Required option "capabilities" is missing.
0-0 worker error { name: 'Error',
message: 'Required option "capabilities" is missing',
stack:
'Error: Required option "capabilities" is missing\n at validateConfig (node_modules/@wdio/config/build/utils.js:80:13)\n at Promise.all.browserNames.map.browserName (node_modules/webdriverio/build/index.js:68:47)\n at Array.map ()\n at multiremote (node_modules/webdriverio/build/index.js:67:34)\n at initialiseInstance (node_modules/@wdio/runner/build/utils.js:77:54)\n at Runner._initSession (node_modules/@wdio/runner/build/index.js:150:87)\n at Runner.run (node_modules/@wdio/runner/build/index.js:67:32)\n at processTicksAndRejections (internal/process/next_tick.js:81:5)' }
The text was updated successfully, but these errors were encountered: