Invert Async popup popup to protractor

I have an asynchronous call when blurring a textbox. On successful asynchronous call, it warns:

var obj = {
    "header.a_currency_name" : "Dollar",
    "header.a_currency_code" : "USD",
    "header.a_currency_symbol" : "$"
}

for(var key in  obj) {
    element(by.model(key)).clear();
    element(by.model(key)).sendKeys(obj[key]);
}

      

In the iteration of the 'for' loop, when it sets a header.a_currency_name

value Dollar

and advances to the next model, it issues a warning.

I want to click "OK" to open an alert box and move on to setting up the next model (ie textbox).

+3


source to share


1 answer


If it's a javascript warning, you can switch to it and accept:

browser.switchTo().alert().accept();

      



You may also need to wait for the warning to appear :

var EC = protractor.ExpectedConditions;
browser.wait(EC.alertIsPresent(), 5000);

      

+1


source







All Articles