I am trying to click one button when we have one banner displaying on window for that have below code written
async userAcceptCookie()
{
if(cplLanding.cookieBanner.isDisplayed()==true)
{
log.console("true")
await cplLanding.cookieBanner.click()
}
}
}
however the code is not working, can anyone share with me the correct approach here.