Open DarthOpto opened 6 years ago
I have a similar problem with Firefox 60. But the issue is with the firefox synchronization with the angular page. The application under test is angular 2.
Same configuration as above
Error while waiting for Protractor to sync with the page: "both angularJS testability and angular testability are undefined. This could be either because this is a non-angular page or because
your test involves client-side navigation, which can interfere with Protractor's bootstrapping
And when I use browser.ignoreSynchronization=true;
Error in browser instance firefox while taking the logs:POST
For Firefox you will need to pass an additional flag marionette:true
in the capabilities
@sri85 I have tried that as well and it did not work.
Hi, @DarthOpto ! I will take a look at your issue and provide feedback or some suggestions. Protractor has problems when is used with Angular2+ apps (especially when app uses angular/material).
Thank you @IgorSasovets
@DarthOpto , I ran your config on my Windows machine and at least two browsers work as expected (Chrome, Firefox). Here are conf.js
// Configuration constants
var baseUrl = 'https://formetoknow.com/';
// Test report setup w/ screenshots
var HtmlScreenshotReporter = require('protractor-jasmine2-screenshot-reporter');
var reporter = new HtmlScreenshotReporter({
dest: 'report',
filename: 'artemis-e2e-report.html'
});
var seleniumServer = process.env.IS_WINDOWS ?
//'http://slc-dev-win-curtis2:4444/wd/hub' : 'http://slc-dev-curtis1:4444/wd/hub';
'http://slc-dev-curtis1:4444/wd/hub' : 'http://127.0.0.1:4444/wd/hub';
var browserCapabilities = [
{
browserName: 'chrome',
seleniumAddress: seleniumServer,
platform: 'ANY',
version: 'ANY',
chromeOptions: {
args: ['--no-sandbox', '--test-type=browser', '--lang=en', '--window-size=1680,1050'],
prefs: {
'credentials_enable_service': false,
'profile': {
'password_manager_enabled': false
},
download: {
prompt_for_download: false,
directory_upgrade: true,
default_directory: 'C:\\downloads\\'
},
},
},
loggingPrefs: { browser: 'SEVERE' }
},
{
browserName: 'firefox',
seleniumAddress: seleniumServer,
},
/*{
browserName: 'internet explorer',
platform: 'ANY',
version: '11',
// seleniumAddress: seleniumServer,
},
{
browserName: 'MicrosoftEdge',
seleniumAddress: seleniumServer,
}*/
];
// Protractor config
exports.config = {
baseUrl: baseUrl,
directConnect: false,
allScriptsTimeout: 25 * 1000,
jasmineNodeOpts: {
defaultTimeoutInterval: 90 * 1000
},
getPageTimeout: 120 * 1000,
specs: ['spec.js'],
multiCapabilities: browserCapabilities,
maxSessions: 1,
framework: 'jasmine2',
onPrepare: function() {
//Set Up a JUnit XML Reporter - Makes a nice test results area and trend graph in Jenkins
var jasmineReporters = require('jasmine-reporters');
jasmine.getEnv().addReporter(new jasmineReporters.JUnitXmlReporter({
consolidateAll: true,
savePath: 'report',
filePrefix: 'xmloutput'
}));
//Setup screenshots
jasmine.getEnv().addReporter(reporter);
},
// Setup the report before any tests start
beforeLaunch: function() {
return new Promise(function(resolve) {
reporter.beforeLaunch(resolve);
});
},
// Close the report after all tests finish
afterLaunch: function(exitCode) {
return new Promise(function(resolve) {
reporter.afterLaunch(resolve.bind(this, exitCode));
});
},
};
and spec.js
describe('Get type example', function()
{
it('should get web app type', async function() {
await browser.get('https://www.osianama.com/');
await browser.sleep(5000);
const script = `return document.querySelector('meta[name="og:type"]').content;`;
const title = await browser.executeScript(script);
expect(title).toEqual('website');
});
});
Did you try to run it on other OS? My node version - 8.9.4
.
Please try my example and provide feedback.
@IgorSasovets So the above may work with firefox, I found out yesterday that our site has an issue with firefox which is getting resolved. Once that has been fixed I will test again. Any thoughts on Edge and IE11?
I commented IE11 and Edge because I haven't these browser on my local machine. You can test it just by removing my comments. I can try it with IE 10 and provide feedback if needed.
Any news on this one? I have the same issue with Edge - only at times though, even for a testcase that if re-run works.
Same results for me no other browser except Chrome is working I have even been running it through SauceLabs now and get the same results.
Protractor does not appear to be working with any other browser than Chrome. I would like be able to run my tests across multiple browsers, but this is a major hindrance.
10.1.0
5.3.2
Firefox 60
.IE11
,Edge
Mac 10.13.5
Protractor config file
// Test report setup w/ screenshots var HtmlScreenshotReporter = require('protractor-jasmine2-screenshot-reporter'); var reporter = new HtmlScreenshotReporter({ dest: 'report', filename: 'artemis-e2e-report.html' });
var seleniumServer = process.env.IS_WINDOWS ? 'http://slc-dev-win-curtis2:4444/wd/hub' : 'http://slc-dev-curtis1:4444/wd/hub'; // 'http://slc-dev-curtis1:4444/wd/hub' : 'http://127.0.0.1:4444/wd/hub';
var browserCapabilities = [ { browserName: 'chrome', seleniumAddress: seleniumServer, platform: 'ANY', version: 'ANY', chromeOptions: { args: ['--no-sandbox', '--test-type=browser', '--lang=en', '--window-size=1680,1050'], prefs: { 'credentials_enable_service': false, 'profile': { 'password_manager_enabled': false }, download: { prompt_for_download: false, directory_upgrade: true, default_directory: 'C:\downloads\' }, }, }, loggingPrefs: { browser: 'SEVERE' } }, { browserName: 'firefox', seleniumAddress: seleniumServer, }, { browserName: 'internet explorer', platform: 'ANY', version: '11', // seleniumAddress: seleniumServer, }, { browserName: 'MicrosoftEdge', seleniumAddress: seleniumServer, } ];
// Protractor config exports.config = { baseUrl: baseUrl, directConnect: false, allScriptsTimeout: 25 1000, jasmineNodeOpts: { defaultTimeoutInterval: 90 1000 }, getPageTimeout: 120 * 1000, suites: { testspecs here },
};
describe('Smoke Tests', () => { beforeAll(() => { jasmine.DEFAULT_TIMEOUT_INTERVAL = 999999 loginPage.login(user.email, user.password) })
}
Stack: Error: Error while running testForAngular: Document was unloaded Build info: version: '3.12.0', revision: '7c6e0b3', time: '2018-05-08T15:15:08.936Z' System info: host: 'USE-DEV-WIN2', ip: '192.168.20.45', os.name: 'Windows 10', os.arch: 'x86', os.version: '10.0', java.version: '1.8.0171' Driver info: driver.version: unknown at executeAsyncScript.then (/Users/csalisbury/src/helios/nodemodules/protractor/built/browser.js:727:23) at ManagedPromise.invokeCallback (/Users/csalisbury/src/helios/node_modules/protractor/nodemodules/selenium-webdriver/lib/promise.js:1376:14) at TaskQueue.execute (/Users/csalisbury/src/helios/node_modules/protractor/nodemodules/selenium-webdriver/lib/promise.js:3084:14) at TaskQueue.executeNext (/Users/csalisbury/src/helios/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:3067:27) at asyncRun (/Users/csalisbury/src/helios/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2927:27) at /Users/csalisbury/src/helios/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:668:7 at process._tickCallback (internal/process/next_tick.js:68:7)
Error: Error while running testForAngular: Page reload detected during async script Build info: version: '3.12.0', revision: '7c6e0b3', time: '2018-05-08T15:15:08.936Z' System info: host: 'USE-DEV-WIN2', ip: '192.168.20.45', os.name: 'Windows 10', os.arch: 'x86', os.version: '10.0', java.version: '1.8.0_171' Driver info: driver.version: unknown Stack: Error: Error while running testForAngular: Page reload detected during async script Build info: version: '3.12.0', revision: '7c6e0b3', time: '2018-05-08T15:15:08.936Z' System info: host: 'USE-DEV-WIN2', ip: '192.168.20.45', os.name: 'Windows 10', os.arch: 'x86', os.version: '10.0', java.version: '1.8.0171' Driver info: driver.version: unknown at executeAsyncScript.then (/Users/csalisbury/src/helios/nodemodules/protractor/built/browser.js:727:23) at ManagedPromise.invokeCallback (/Users/csalisbury/src/helios/node_modules/protractor/nodemodules/selenium-webdriver/lib/promise.js:1376:14) at TaskQueue.execute (/Users/csalisbury/src/helios/node_modules/protractor/nodemodules/selenium-webdriver/lib/promise.js:3084:14) at TaskQueue.executeNext (/Users/csalisbury/src/helios/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:3067:27) at asyncRun (/Users/csalisbury/src/helios/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2927:27) at /Users/csalisbury/src/helios/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:668:7 at process._tickCallback (internal/process/next_tick.js:68:7)
WebDriverError: Unable to parse remote response: Unknown error Build info: version: '3.12.0', revision: '7c6e0b3', time: '2018-05-08T15:15:08.936Z' System info: host: 'USE-DEV-WIN2', ip: '192.168.20.45', os.name: 'Windows 10', os.arch: 'x86', os.version: '10.0', java.version: '1.8.0_171' Driver info: driver.version: unknown at Object.checkLegacyResponse (/Users/csalisbury/src/helios/node_modules/protractor/node_modules/selenium-webdriver/lib/error.js:546:15) at parseHttpResponse (/Users/csalisbury/src/helios/node_modules/protractor/node_modules/selenium-webdriver/lib/http.js:509:13) at doSend.then.response (/Users/csalisbury/src/helios/node_modules/protractor/node_modules/selenium-webdriver/lib/http.js:441:30) at process._tickCallback (internal/process/next_tick.js:68:7) From: Task: WebDriver.createSession() at Function.createSession (/Users/csalisbury/src/helios/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver.js:769:24) at createDriver (/Users/csalisbury/src/helios/node_modules/protractor/node_modules/selenium-webdriver/index.js:170:33) at Builder.build (/Users/csalisbury/src/helios/node_modules/protractor/node_modules/selenium-webdriver/index.js:635:14) at Hosted.getNewDriver (/Users/csalisbury/src/helios/node_modules/protractor/built/driverProviders/driverProvider.js:53:33) at Runner.createBrowser (/Users/csalisbury/src/helios/node_modules/protractor/built/runner.js:195:43) at q.then.then (/Users/csalisbury/src/helios/node_modules/protractor/built/runner.js:339:29) at _fulfilled (/Users/csalisbury/src/helios/node_modules/q/q.js:834:54) at /Users/csalisbury/src/helios/node_modules/q/q.js:863:30 at Promise.promise.promiseDispatch (/Users/csalisbury/src/helios/node_modules/q/q.js:796:13) at /Users/csalisbury/src/helios/node_modules/q/q.js:556:49