dequelabs / axe-core-maven-html

Tools for using axe for web accessibility testing with JUnit, Selenium, and Playwright

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"No elements found for include in page context " error appearing when `include` having multiple web elements

padmavemulapati opened this issue · comments

Steps to reproduce:
on axe-core-maven-html: when tested for include method on multiple web elements
AxeBuilder().include(Arrays.asList("div", "h1")).analyze(webDriver);
results are blank. and giving "No elements found for include in page context"
image (15)

In oder to include multiple elements you call include multiple times with each individual selector. include takes a list of selectors solely to select elements inside iframes.

Discussed with Adam,
with the change in the test code snippet:
Results result = new AxeBuilder().include(Arrays.asList("div")).include(Arrays.asList("h1")).analyze(webDriver); instead
AxeBuilder().include(Arrays.asList("div", "h1")).analyze(webDriver);
its giving the expected results.