Comments (5)
Hi @Zidious,
Thanks for the quick response. I am not using any iframe.
Here is the console output of the html when no exclude is used:
Rule id: aria-allowed-attr
Html: <span title="No selection" class="k-widget k-dropdown" unselectable="on" role="listbox" aria-haspopup="listbox" aria-expanded="false" tabindex="0" aria-owns="cc244dc7-18ba-466b-9bf9-9de2de29c84b_listbox" aria-controls="cc244dc7-18ba-466b-9bf9-9de2de29c84b_listbox" aria-live="polite" aria-disabled="false" aria-readonly="false" aria-busy="false" aria-activedescendant="a03bb34d-7ea1-4aed-aa97-46a5a7f117e7" aria-labelledby="typeLabel" style="">
Target: [span[aria-labelledby="typeLabel"]]
Rule id: aria-allowed-role
Html: <ul role="none" class="has-hover" style="display: none;">
<li tabindex="0" role="menuitem">
Event Messages Limit
</li>
</ul>
Target: [.has-hover]
Rule id: label
Html: <input checked="checked" id="filter_checkbox_view577" type="checkbox">
Target: [#filter_checkbox_view577]
When I used the exclude individualy:
axeBuilder.exclude(".has-hover");
or
axeBuilder.exclude(".k-dropdown");
I can see the violation being excluded correctly.
When I use them together:
axeBuilder.exclude(".k-dropdown").exclude(".has-hover")
only the first exclude is actually working.
Rule id: aria-allowed-role
Html: <ul role="none" class="has-hover" style="display: none;">
<li tabindex="0" role="menuitem">
Event Messages Limit
</li>
</ul>
Target: [.has-hover]
Rule id: label
Html: <input checked="checked" id="filter_checkbox_view577" type="checkbox">
Target: [#filter_checkbox_view577]
from axe-core-maven-html.
Hi, I was able to reproduce the issue with the example page that you have provided in my project. However, it works correctly when I created a new maven project. So I think there is a configuration issue somewhere on my end. I will need investigate further but I think my question is answered.
Thank you!
from axe-core-maven-html.
Hey @kailunc,
Just tested on this example page:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Context Test</title>
</head>
<body>
<h1>Context Test</h1>
<div class="some-class">
<img src="http://placehold.it/350x150" />
</div>
<div class="some-other-class">
<img src="http://placehold.it/150x150" />
</div>
</body>
</html>
Using the below example:
import com.deque.html.axecore.results.CheckedNode;
import com.deque.html.axecore.results.Results;
import com.deque.html.axecore.results.Rule;
import com.deque.html.axecore.selenium.AxeBuilder;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import java.util.List;
public class Main {
public static void main(final String[] args) throws InterruptedException {
WebDriver driver = new ChromeDriver();
// Serving the page locally with a simple web server
driver.get("http://127.0.0.1:5504/index.html");
// Comment out the line below to see the image-alt violations:
AxeBuilder builder = new AxeBuilder();
// AxeBuilder builder = new AxeBuilder().exclude(".some-class").exclude(".some-other-class");
Results results = builder.analyze(driver);
List<Rule> violations = results.getViolations();
for (Rule rule : violations) {
// Just check image-alt rule for this example
if (rule.getId().equals("image-alt")) {
for (CheckedNode node : rule.getNodes()) {
System.out.printf("Node: %s %n", node.getHtml());
}
}
}
driver.quit();
}
}
With AxeBuilder builder = new AxeBuilder();
(see snippet), I am seeing the below in the console:
Node: <img src="http://placehold.it/350x150">
Node: <img src="http://placehold.it/150x150">
With AxeBuilder builder = new AxeBuilder().exclude(".some-class").exclude(".some-other-class");
I am not seeing any image-alt violations being printed to the console.
Would you mind providing some more context on what you're trying to exclude? Is it a particular CSS selector within an iframe?
from axe-core-maven-html.
Is the site that you're testing public or are you able to scaffold / link to a github where I can test the page to see what's happening at all?
from axe-core-maven-html.
Moving this ticket done, as the Question answered and resolved.
from axe-core-maven-html.
Related Issues (20)
- Selenium dropped support for Java 8
- Add creating a canary on push into release in deploy.yml
- Send to Slack when RC ready for QA HOT 1
- Run update axe-core GHA nightly HOT 1
- Consolidate Result/AxeResults to one class/package HOT 2
- tech-debt: mockito-core >4 requires Java 11 minimum HOT 1
- Move publishing from CircleCI to GHA
- Require QA consideration in PRs HOT 1
- Add timeout to all github actions in repo
- Selenium: If/when we decide to drop support for Selenium 3 consume Selenium 4 API
- dequelabs/axe-core-maven-html v4.8.1 HOT 1
- dequelabs/axe-core-maven-html v4.8.2
- dequelabs/axe-core-maven-html v4.8.2
- dequelabs/axe-core-maven-html v4.8.2 HOT 1
- Java Lang Runtime Exception: switchToWindow failed. Are you using updated browser drivers? Please check out HOT 11
- Create bug report and feature request issue templates in repo HOT 1
- dequelabs/axe-core-maven-html v4.9.0 HOT 1
- Add issues reporting steps to docs HOT 2
- Update how repo downloads Chromedriver
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from axe-core-maven-html.