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
1,972 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
389 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,110 points
2,064 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 21, 2019 in Selenium by Abha
• 27,930 points
4,232 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,520 points
3,784 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

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

answered Aug 31 in Selenium by Sri
• 2,970 points
4,766 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,890 points
2,742 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 2 in Selenium by Sri
• 2,970 points
3,109 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
3,599 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
2,824 views