How to configure rules for wcag2aa in axe-core for selenium java
问题 I want to add rules in axe in selenium for wcag2aa. Can anyone help me with the syntax? JSONObject responseJSON = new AXE.Builder(getBrowser() .getWebDriver(), scriptUrl).options( ("{ rules: { 'wcag2aa' } }")).analyze(); I have tried the above code but it is giving me exception Thanks. 回答1: wcag2aa is a list of rules and not a rule itself. Try: .options("{ runOnly: ['wcag2aa'] }") Or you can only run multiple lists of rules like so: .options("{ runOnly: ['wcag2a', 'wcag2aa', 'best-practice']