1

I used protractor a long time, install django and update python in Mac OS X (Mavericks), after this:

browser.wait(function(){ element.isPresent() }); 

does not work properly and show the message above:

Message:

    Error: Wait timed out after 270ms

   Stacktrace:

    Error: Wait timed out after 270ms
    at Array.forEach (native)
    at runMicrotasksCallback (node.js:337:7)
    at process._tickCallback (node.js:355:11)

From: Task: < anonymous wait >

How could I fix this?

alecxe
  • 462,703
  • 120
  • 1,088
  • 1,195

1 Answers1

2

There is at least one problem with your custom wait function is that you don't have a return. But, anyway, there is a presenceOf built-in ExpectedCondition that fits your use case:

var EC = protractor.ExpectedConditions;
browser.wait(EC.presenceOf(element), 5000);
Community
  • 1
  • 1
alecxe
  • 462,703
  • 120
  • 1,088
  • 1,195
  • Hi Alecxe, this wait.browser does not work correctly in parts of the page that does not have angularJS, for instance slickgrid, about the question, it's my mistake I used: browser.wait(function(){ return element.isPresent().then(function(show){ if (show){} return element.isDisplayed(); }); }); -----> I do not know why this code broken when I updated protractor and selenium webdriver. Thank's. – ChrisGGuerra Jun 19 '15 at 14:13