-
Notifications
You must be signed in to change notification settings - Fork 2.3k
browser.ignoreSynchronization=true is not recognized after browser.restart() #3677
Comments
Thanks for the test case! It looks like this was caused by #3651, which was trying to fix #3648. The heart of the issue is that when browser.restart() creates a new browser instance and copies it's properties over to the existing global browser instance, the webdriver mixins still have a waitForAngular call that's bound to the old instance. Luckily, it looks like the only thing this would break is ignoreSynchronization after a browser.restart() call. |
@mgiambalvo: I believe this issue may affect browser.ignoreSynchronization in more cases than just when browser.restart is called. I am still seeing Protractor.waitForAngular() getting called after I have set browser.ignoreSynchronization to true. EDIT:In my situation, I think _browser.restart() was being called by protractor-cucumber-framework. Not sure about this though... |
After updating Protractor from 4.0.9 to 4.0.10 I'm getting: Failed: Error while waiting for Protractor to sync with the page: "window.angular is 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. See http://git.io/v4gXM for details" |
Hi There, the test opens the page and waits to have a certain part in the url using the function bellow, the tests are using this.waitForUrl = function(url, timeout) {
timeout = timeout || DEFAULT_WAIT_FOR_TIMEOUT;
return this.browser.wait(EC.urlContains(url), timeout, 'waiting url to contains ' + url);
}; I am getting this error: Failed: This driver instance does not have a valid session ID (did you call WebDriver.quit()?) and may no longer be used.
NoSuchSessionError: This driver instance does not have a valid session ID (did you call WebDriver.quit()?) and may no longer be used.
at WebDriverError (/home/ubuntu/xxx/node_modules/selenium-webdriver/lib/error.js:27:5)
at NoSuchSessionError (/home/ubuntu/xxx/node_modules/selenium-webdriver/lib/error.js:170:5)
at checkHasNotQuit (/home/ubuntu/xxx/node_modules/selenium-webdriver/lib/webdriver.js:395:15)
at Driver.schedule (/home/ubuntu/xxx/node_modules/selenium-webdriver/lib/webdriver.js:356:5)x
at Driver.getCurrentUrl (/home/ubuntu/xxx/node_modules/selenium-webdriver/lib/webdriver.js:804:17)
at /home/ubuntu/xxx/node_modules/protractor/built/expectedConditions.js:306:41 The screenshot from this failure clearly shows that the page is fully loaded and has its content so I guess this might be a bug. I guess that is related to this issue too. Anyway, thank you for your help. Best regards, |
Here is the failing test case: describe('This driver instance does not have a valid session ID', function() {
var EC = protractor.ExpectedConditions;
function waitForUrl(url) {
browser.wait(EC.urlContains(url), 5000).then(function() {
console.log(url + ' found');
})
}
it('Browser wait for url fails', function() {
browser.get("https://angularjs.org/");
waitForUrl('angular');
browser.restart();
browser.get("https://angularjs.org/");
//fails here // This driver instance does not have a valid session ID (did you call WebDriver.quit()?) and may no longer be used.
waitForUrl('angular');
});
it('Browser ignoreSynchronization fails', function() {
browser.get("https://angularjs.org/");
browser.restart();
browser.get("https://angularjs.org/");
browser.ignoreSynchronization = true;
browser.get("https://github.com/");
waitForUrl('github'); //fails here This driver instance does not have a valid session ID (did you call WebDriver.quit()?) and may no longer be used.
browser.ignoreSynchronization = false;
browser.restart();
browser.get("https://angularjs.org/");
waitForUrl('angular');
});
}); here is protractor.conf {
rootElement: 'html', //it fails also with [ng-app]
allScriptsTimeout: 110000,
baseUrl: 'http://localhost:9000',
chromeOnly: true,
directConnect: true,
exclude: [],
capabilities: { browserName: 'chrome' },
framework: 'jasmine',
jasmineNodeOpts: { defaultTimeoutInterval: 15000, random: false },
specs: [ 'e2e/**/*.spec.*.js', 'e2e/**/*.spec.js' ]
} |
yes, this issue still occurs |
This actually looks like a separate issue. I've opened #3881 to track it to avoid confusion. |
Setting
browser.ignoreSynchronization = true;
afterbrowser.restart()
is ignored.Output:
Failed: Error while waiting for Protractor to sync with the page: "window.angular is 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. See http://git.io/v4gXM for details"
Protractor 4.0.10
Chromedriver 2.25
Chrome 54.0.2840.71
The text was updated successfully, but these errors were encountered: