You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 19, 2021. It is now read-only.
If I have axe-core running on a website, and I try to run it with a context like window.axe.run("#elementThatDoesntExist"), an error is printed to the console.
However, if I am using axe-webdriverjs, and I try to call this, then my code just hangs:
Since this is invoked inside a driver.executeAsyncScript function, the only way to exit that script is to call arguments[arguments.length - 1]. However, if an error is thrown while running window.axe.run, there is nothing to catch that error, so driver.executeAsyncScript doesn't actually exit, unless some kind of timeout forces it to exit.
The text was updated successfully, but these errors were encountered:
const AxeBuilder = require("axe-webdriverjs");
const webdriver = require("selenium-webdriver");
require("chromedriver"); // if you don't have it installed separately
(async function(){
const driver = new webdriver.Builder().forBrowser("chrome").build();
await driver.get("http://www.google.com");
await AxeBuilder(driver)
.include("#viewport")
.analyze((error, results) => {
console.log(`There were ${results.violations.length} violations`);
});
await AxeBuilder(driver)
.include("#doesNotExist")
.analyze((error, results) => {
console.log(error);
console.log("This prints after the script timeout error.");
});
})();
juliannalangston
changed the title
AxeInjector hangs when provided invalide "include" elements
AxeInjector hangs when provided invalid "include" elements
Sep 23, 2020
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
If I have axe-core running on a website, and I try to run it with a context like
window.axe.run("#elementThatDoesntExist")
, an error is printed to the console.However, if I am using axe-webdriverjs, and I try to call this, then my code just hangs:
The error message never gets surfaced.
I found that, on axe-webdriverjs/lib/index.js:159, there's this code:
Since this is invoked inside a
driver.executeAsyncScript
function, the only way to exit that script is to callarguments[arguments.length - 1]
. However, if an error is thrown while running window.axe.run, there is nothing to catch that error, sodriver.executeAsyncScript
doesn't actually exit, unless some kind of timeout forces it to exit.The text was updated successfully, but these errors were encountered: