I have an application where it navigates away to an Non-Angular app for login. The basic login is like this. First, loads the angular app, then click on a button on the page. Then navigates away to a non angular app (STS implemented with IdentityServer) and logs in, Then navigates back to the angular app.
Here is the code i wrote to handle this.
this.login = function (userId) {
browser.driver.get(browser.params.host.hostname);
browser.driver.findElement(by.id('continuebutton')).click();
browser.driver.wait(function () {
browser.driver.findElement(by.xpath("//*[@id=\"body\"]/section/div[2]/div[3]/a")).click();
browser.driver.findElement(by.id("UserName")).sendKeys(userId);
browser.driver.findElement(by.id("Password")).sendKeys("flisdev");
browser.driver.findElement(by.tagName("button")).click();
}, 10000);
};
But this throws 'Angular not found on page" error and sometimes randomly element not found error for the link referenced by the XPath. basic flow of the login is like
Angular App --> Non-Angualr App --> Angular App
How can i handle this kind of login?