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
3,680 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,460 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
1,778 views
0 votes
2 answers
0 votes
1 answer

Is it possible to use webdriverwait for checking the visiblity of an element in webdriver?

Hello Jagdeep, Yes it is possible to ...READ MORE

answered Jul 4, 2019 in Selenium by Anvi
• 14,150 points
4,388 views
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 22, 2019 in Selenium by Abha
• 28,140 points
21,008 views
0 votes
2 answers

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,500 points
13,772 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

enable trusted connection  in internet explorer by ...READ MORE

answered Aug 31, 2020 in Selenium by Sri
• 3,190 points
9,187 views
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,910 points
7,263 views
0 votes
2 answers

How to use such xpath to find web elements

xpath are two types. 1) Absolute XPath:    /html/b ...READ MORE

answered Sep 3, 2020 in Selenium by Sri
• 3,190 points
7,902 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,460 points
7,471 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,460 points
4,609 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP