I want to click an element which display
property is none
.
How can I do this?
Code:
page.click(".foo");
You can use the JavaScript click
function. This function will trigger the elements click event and does not care about whether the element is visible or not.
You need to use page.evaluate
to execute it inside the page.
Example:
await page.evaluate(() => {
document.querySelector('.foo').click();
});