question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to wait to load the element in browser

See original GitHub issue

hi i created a common function to wait to load page but not working the code.

this.waitForElements=function(element){
for (var sec = 0;; sec++) {
if(sec>120){ break; } if(this.checkingElement(element)==true){ break; } browser.sleep(1000);
} };

    this.checkingElement=function(availableElement){        
        val=false;
        availableElement.isPresent().then(function(){
            val=true;
        });
    return val;
    };

when i call ‘waitForElements(pageobject element)’ i am getting error while waiting for Protractor to sync with the page how to control this one. script was executing with out wait .

Thanks& Regards OmPrakash

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
juliemrcommented, Jul 8, 2014

Thanks for the detailed answer, @elgalu

Please post questions like this on Stack Overflow so that we can keep the issue tracker clean for bugs and feature requests. Thanks!

0reactions
gijopcommented, Mar 9, 2018

But here it will wait until the wait time expires, i think it is not a good way. Any other way to wait for the locator upto the presence or availability of that ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to wait for an element before proceeding
This wait is built into the APIs that Load Tester uses to interface with the browser (Selenium/WebDriver). After that API returns, the step...
Read more >
How to get Selenium to wait for a page to load - BrowserStack
Wondering how to wait for a web page to load in Selenium testing? Read tutorial to understand 3 methods to execute the same....
Read more >
How to wait for a page to load or element to be present when ...
describe('Search', function() { it('should click Search button and wait for results', function() { browser.driver.findElement(by.id('search')).click(); }); });.
Read more >
How do I wait for the Browser to finish loading the page - Studio
The browser must know when the page is loading and when it's finished loading as it displays spinning circle wait indicator.
Read more >
Use Selenium wait for page to load with Python [Tutorial]
Selenium wait in Python gives additional time for loading of the WebElements in the DOM. In this article, we deep dive into the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found