Protractor waiting for element to be in DOM

0 votes

I have been having some trouble using Protractor. I have a really weird ui-router state where its 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();
});
Sep 17, 2018 in Selenium by Atul
• 10,240 points
596 views

1 answer to this question.

0 votes

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');
answered Sep 17, 2018 by Meci Matt
• 9,420 points

Related Questions In Selenium

0 votes
1 answer

Wait for an element to be accessible using Selenium WebDriver

You can try out the below code: ...READ MORE

answered May 18, 2018 in Selenium by Atul
• 10,240 points
122 views
0 votes
1 answer
0 votes
1 answer

How to use Chropath for locating web element in selenium?

Hey Angad, you can follow these steps ...READ MORE

answered Aug 21 in Selenium by Abha
• 23,030 points
25 views
0 votes
1 answer

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,090 points
588 views
0 votes
1 answer
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,130 points
898 views
0 votes
1 answer

How to use such xpath to find web elements

It's much simpler to use: #MyDiv123 > div.super or ...READ MORE

answered Jun 14, 2018 in Selenium by Samarpit
• 5,130 points
574 views
0 votes
1 answer

How to pause for few seconds in Selenium?

you can locate an element that loads ...READ MORE

answered Jul 6, 2018 in Selenium by Meci Matt
• 9,420 points
625 views
0 votes
1 answer

How to close tab in WebDriver or Protractor

Switch to the newly opened tab. Close ...READ MORE

answered Aug 16, 2018 in Selenium by Meci Matt
• 9,420 points
1,569 views