Using Protractor to run automation cases in Firefox and Chrome.
Chrome does not ask for popup by default but firefox does.So i had to add extra lines for FF.Below is the code. But it is not working. The file am downloading is an excel but i could see the content type as 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' in the dev window.Is that right? should i change it so something else?I tried Download file on Firefox with protractor but it threw AssertionError: WebDriverError: Build info: version: '3.8.1', revision: '6e95a6684b', time: '2017-12-01T19:05:32.194Z'.So I'm using below approach to download to download folder which does not throw an error but still not working as expected
let profile = require('firefox-profile');
let firefoxProfile = new profile();
// _browser = 'chrome';
_browser = 'firefox';
firefoxProfile.setPreference("browser.download.folderList", 2);
firefoxProfile.setPreference("browser.helperApps.neverAsk.saveToDisk",'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
exports.config = {
framework: 'custom',
frameworkPath: require.resolve('protractor-cucumber-framework'),
capabilities: {
'browserName': _browser,
'shardTestFiles': false,
'maxInstances': 1,
'acceptInsecureCerts': true,
'moz:firefoxOptions': {
'args': ['--safe-mode'],
'profile': firefoxProfile
}
},