I am trying to check a link in a table that opens a new window. I want to check the url of a new window.
What I still know:
it('Should verify new window url', function () { page.list.get(0).click().then(function () { browser.getAllWindowHandles().then(function (handles) { newWindowHandle = handles[1]; browser.switchTo().window(newWindowHandle).then(function () { expect(browser.getCurrentUrl()).toMatch(/\/url/); }); }); }); });
Error: Error while waiting for Protractor to synchronize with the page: {}
It works if I remove the wait .... I'm confused about promises, can anyone direct me in the right direction?
Thibs source share