0 votes
1 view
in DevOps and Agile by (19.8k points)

I have been having some trouble using Protractor. I have a really weird ui-router state where it's hard to go off of other elements to start working with the page. Is there any way to tell protractor to wait until an element finally appears in the DOM? Not visible/displayed, but actually created? I keep trying to use wait for the element but it is clearly not available to be selected.

browser.driver.wait(function () {

    return elem.isDisplayed();

});

1 Answer

0 votes
by (63.4k points)

You should be able to use browser.wait together with the presenceOf ExpectedCondition:

 

var until = protractor.ExpectedConditions;

browser.wait(until.presenceOf(elem), 5000, 'Element taking too long to appear in the DOM');

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...