axe-webdriverjs icon indicating copy to clipboard operation
axe-webdriverjs copied to clipboard

axe-webdriverjs deprecated

Open mgifford opened this issue 5 years ago • 3 comments

I was trying to run axe-reports & got this error: axe-webdriverjs deprecated Error must be handled as the first argument of axe.analyze.

Am I doing something wrong, is this a node issue or what?

Thanks!

mgifford avatar Mar 06 '20 23:03 mgifford

I believe you need to pass error and results to the callback function of axeBuilder.analyze:

AxeBuilder(driver).analyze(function(err, results) {
  if (err) {
    // Handle error somehow
  }
  console.log(results);
});

Seems the old code may have allowed just results.

straker avatar Mar 09 '20 22:03 straker

As @straker mentioned, you just need to add the error part to the callback function of Analyze

manoj9788 avatar May 23 '20 14:05 manoj9788

Just a heads up - we're removing support for the deprecated callback signature soon.


This will no longer work:

AxeBuilder(driver).analyze(function(results) {
  // ...
})

Instead, you must handle the error:

AxeBuilder(driver).analyze(function(err, results) {
  // ...
})

stephenmathieson avatar May 27 '20 17:05 stephenmathieson