I'm experiencing an issue with a cookie popup that I'm trying to interact with or disable in order to ensure the accuracy of my Axe accessibility tests. What would be the most effective approach in this scenario? Currently, I am attempting to click on the popup, but encountering an error message ('intermediate value').findelement is not a function. Ideally, I would like to prevent the popup from appearing when selenium initiates chrome.
const AxeBuilder = require('@axe-core/webdriverjs');
const WebDriver = require('selenium-webdriver');
const {By} = require('selenium-webdriver');
const driver = new WebDriver.Builder().forBrowser('chrome').build();
driver.get('mysite').then( () => {
new AxeBuilder(driver)
.findElement(By.id('accept')).click()
.analyze((err, results) => {
if (err) {
// Handle error somehow
}
console.log(results.violations);
});
});