I am automating a website in which I want to click on the x when a subscription popup comes up The HTML for the X is
<button title="Close popup message" data-testid="email-popup-close-button" id="email-popup-close-button" class="dw-1hfj58t-CloseBtn--EmailContainer e1lwf35p0">×</button>
So to click on this I am using the below
await driver.findElement(By.id("email-popup-close-button")).click();
But it is coming up with the below error
NoSuchElementError: no such element: Unable to locate element: {"method":"css selector","selector":"*[id="email-popup-close-button"]"}