Hi I'm having an issue with a cookie popup which Im trying to either click on or disable somehow as I think it is affecting the output of my Axe accessibility tests. What would be the best approach? Currently I'm just trying to click on it but getting an error (intermediate value).findelement is not a function. Ideally I'd want to stop the pop up appearing when selenium fires up 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);
});
});