Protractor did not run properly when using browser.wait, msg: "Wait timed out after XXXms"

289 views Asked by At

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?

1

There are 1 answers

1
alecxe On

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);