user6488351
user6488351

Reputation:

Wait for an element in Protractor

My Protractor test is failing when I'm trying to click a button.

In my application first button is disabled. This button enables after clicking another button.

I need a way to wait Protractor until the button is enabled. Is there any way to do it?

Upvotes: 0

Views: 3078

Answers (1)

TesterABC
TesterABC

Reputation: 1226

You better try the answer here.

If you need a quick and direct answer try this.

var elm = element(by.id('paynow-info-btn'));
var EC = protractor.ExpectedConditions;

browser.wait(EC.elementToBeClickable(elm), 5000);
elm.click();

Hope this helps :)

Upvotes: 2

Related Questions