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
Hello, I'm trying to check the element(s) that are inside the iframe, but I don't understand how to do it normally. I keep catching the error no such element: element not found
(Session info: chrome=127.0.6533.120).
What is there?
There is a page where the DOM tree looks something like this:
Unfortunately, all this did not help me achieve the desired goal, in general, there are quite a few (as it seems to me) examples in the documentation, which raises questions
(com.deque.html.axe-core:selenium:4.9.1)
The text was updated successfully, but these errors were encountered:
The error you're getting: error no such element: element not found appears to be coming from Selenium not axe-core-maven-html-selenium package. Using the fromFrames API (docs) you can limit the testing scope to elements within your iframe. Below I have an example page that has an iframe element and a class attribute (similar to your snippet called modal-new_payment-frame) that loads some content.
To limit testing to the saidiframe and everything with the div that has an id of hook_Block_SendBlock you can do:
WebDriverwebDriver = newChromeDriver();
webDriver.get("<url>");
// Limit testing to everything with the `hook_Block_SendBlock` div within the `.modal-new_payment-frame` iframe:AxeBuilderaxeBuilder =
newAxeBuilder().include(newFromFrames(".modal-new_payment-frame", "#hook_Block_SendBlock"));
List<Rule> results = axeBuilder.analyze(webDriver).getViolations();
for (Rulerule : results) {
System.out.println(rule.getId());
System.out.println(rule.getDescription());
}
webDriver.quit();
Product
axe-core
Question
Hello, I'm trying to check the element(s) that are inside the iframe, but I don't understand how to do it normally. I keep catching the error no such element: element not found
(Session info: chrome=127.0.6533.120).
What is there?
There is a page where the DOM tree looks something like this:
This is a rough outline of the page code, I tried to omit all the details, but left the structure
I tried to work with an iframe like this:
In getA11Y I configure the operation of axe
And in the testA11Y function, I run the analysis
I tried to run the analysis in various ways, including using include, but it didn't help
https://dequeuniversity.com/rules/axe/4.9/frame-tested?application=axeAPI
https://github.com/dequelabs/axe-core-maven-html/blob/develop/playwright/README.md#limit-frame-testing
Unfortunately, all this did not help me achieve the desired goal, in general, there are quite a few (as it seems to me) examples in the documentation, which raises questions
(com.deque.html.axe-core:selenium:4.9.1)
The text was updated successfully, but these errors were encountered: