I am using WebdriverIO to connect my Appium test script to Browserstack. My project structure is basically the same as the example here: https://github.com/browserstack/webdriverio-appium-app-browserstack/tree/master/ios
Using our own app, the test takes around 6-9 minutes to start. When investigating the video recording, the app is opened immediately, it just stays on the first screen for several minutes before executing the commands.
[12:03:32] COMMAND POST "/wd/hub/session"
[12:03:32] DATA {"desiredCapabilities":{"javascriptEnabled":true,"locationContextEnabled":true,"handlesAlerts":true,"rotatable":true,"name":"Sign_Up","build":"PBA_iOS","device":"iPhone 7 Plus","app":"XXXXXXXX","browserstack.debug":true,"requestOrigins":{"url":"http://webdriver.io","version":"4.13.2","name":"webdriverio"}}}
[12:09:20] INFO SET SESSION ID 2be9267fe9bae10f3fef233698954493bb33fdc7
[12:09:20] RESULT {"webStorageEnabled":false,"locationContextEnabled":true,"browserName":"","platform":"MAC","javascriptEnabled":true,"databaseEnabled":false,"takesScreenshot":true,"networkConnectionEnabled":false,"han ... (1268 more bytes)
[12:09:20] COMMAND POST "/wd/hub/session/2be9267fe9bae10f3fef233698954493bb33fdc7/elements"
[12:09:20] DATA {"using":"accessibility id","value":"OK"}
[12:09:20] RESULT [{"ELEMENT":"D4CDA7B7-2EC7-422B-AD3C-1BF40E73ECBA"}]
You can see in the console logs that the long wait happens after sending desired capabilities. Is there a way to speed it up?
My conf file:
exports.config = {
user: 'XXXXXXXXXXX',
key: 'XXXXXXXXXXXXXXXXX',
updateJob: false,
specs: [
'./tests/signup.spec.js'
],
exclude: [],
capabilities: [{
name: 'Sign_Up',
build: 'PBA_iOS',
device: 'iPhone 7 Plus',
app: 'XXXXXXXX',
'browserstack.debug': true
}],
logLevel: 'verbose',
coloredLogs: true,
screenshotPath: './errorShots/',
baseUrl: '',
waitforTimeout: 10000,
connectionRetryTimeout: 90000,
connectionRetryCount: 3,
framework: 'mocha',
mochaOpts: {
ui: 'bdd',
timeout: 40000
}
};
In case it matters, I am still on a trial (and the issue is especially annoying as the 10 second test case eats up minutes of the trial timer waiting).
This usually occurs if your app has some pop up while launching which increases the launch time. Include the capability waitForQuiescence: false and try again.