I am unable to click ShowDates button from the url through automation .
I am trying to read web element(through button id/class) as shown below
let SHOW_DATES_BUTTON = By.css('.btn-secondary.btn-sub-action.show-dates-button');
async ShowDatesButton(){
return await this.baseClassWebDriver.wait(Until.elementsLocated(SHOW_DATES_BUTTON));
}
async go(){
let demoSRPage = new DemoSRPage(this.url, this.baseClassWebDriver);
await demoSRPage.go().then(async () => {
await demoSRPage.showDatesButton().then(async (showDateBtn) => {
await showDateBtn.click().then(async () => {
pause(20000);
await demoSRPage.getLastHandle(demoSRPage.baseClassWebDriver);
});
});
});
}
I am getting an error : showDateBtn.click() is not a function
Can somebody please help me through