I am trying to run protractor test(ios-11, iPhoneX)in browserstack. I am getting "Error: Error while running testForAngular: Unable to communicate to node"
error and some time I am getting the error as "Could not find Angular on page".
In fact this is an angular application and I can run test on android and in all desktop browsers. my config file is below, when i used browser.ignoreSynchronization = 'true'
before the browser.get()
than the tests will pass on iOS 10.3. As I am testing the angular application and I don't want to use it. Can you please help on this.
var browserstack = require('browserstack-local');
exports.config = {
seleniumAddress: 'http://hub-cloud.browserstack.com/wd/hub',
'commonCapabilities': {
'browserstack.local': true,
'browserstack.user': '............',
'browserstack.key': '.............'
},
multiCapabilities: [
{
'device': 'iPhone X',
'realMobile': 'true',
'os_version': '11.0',
browserName: 'safari'
},
],
specs:['./myspec.js'],
allScriptsTimeout: 60000,
maxSessions: 1,
jasmineNodeOpts: {
defaultTimeoutInterval: 300000,
showColors: true,
showTiming: true,
includeStackTrace: true,
isVerbose: true,
realtimeFailure: true,
print: function() {
}
},
framework: 'jasmine2',
rootElement: 'body',
// Code to start browserstack local before start of test
beforeLaunch: function() {
console.log('Connecting local');
return new Promise(function (resolve, reject) {
exports.bs_local = new browserstack.Local();
exports.bs_local.start({'key': exports.config.commonCapabilities['browserstack.key']}, function (error) {
if (error) {
console.log(error.message);
return reject(error);
}
console.log('Connected. Now testing...');
resolve();
});
});
},
// Code to stop browserstack local after end of test
afterLaunch: function() {
return new Promise(function (resolve) {
exports.bs_local.stop(resolve);
console.log('Stopping...');
});
},
};
// Code to support common capabilities
exports.config.multiCapabilities.forEach(function(caps){
for(var i in exports.config.commonCapabilities) caps[i] = caps[i] || exports.config.commonCapabilities[i];
});