How to use wait for element to be clickable and wait for element to be present in protractor? I know this will help only with 1 element. Not for all.
For Example:-
Here is the website link, I am trying to automate using protractor and I do not want to use sleep in any case.
Steps to reproduce:-
- Navigate to https://www.celebritycruises.com.
- Click on Find A Cruise at top left corner and click on Find Cruise button.
- It will be navigated to this link - celebritycruises.com/spa/#/itinerary-search.
Now here is the thing, This page takes time to load. So, I am trying to wait for the element or wait for element to be clickable. But it is getting failed.
browser.get('https://www.celebritycruises.com');
var pop = element(by.css('a.popover-find-cruise')); pop.click().then(function() { element.all(by.css('.cta.find-cruise-button button')).last().click(); }); var dta = element(by.css('.itinerary-search.spa #nav-departure-date')); var EC = protractor.ExpectedConditions; browser.wait(EC.visibilityOf(dta), 30000); dta.click();
Can you please help me on this?