Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Selenium) Chrome > 128 fails to run on lazy loaded iframes #480

Open
Zidious opened this issue Sep 25, 2024 · 0 comments
Open

(Selenium) Chrome > 128 fails to run on lazy loaded iframes #480

Zidious opened this issue Sep 25, 2024 · 0 comments
Assignees
Labels
QA: required This ticket requires QA signoff SIZE: medium Medium work effort web-apis

Comments

@Zidious
Copy link
Contributor

Zidious commented Sep 25, 2024

Since chrome >= 128 passing --headless will default to use --headless=new. This causes the lazy loaded iframe to have unwanted side effects when running axe and does not catch the #lazy-frame as part of the incomplete results. I have verified that this is also the case in fully headed mode. Note: this also is an issue with our @axe-core/webdriverjs integration when running fully headed or headless=new.

The test in question:

@Test
public void withUnloadedIframes() {
webDriver.get(fixture("/lazy-loaded-iframe.html"));
String title = webDriver.getTitle();
AxeBuilder axeBuilder = new AxeBuilder().withRules(Arrays.asList("label", "frame-tested"));
Results axeResults = axeBuilder.analyze(webDriver);
assertNotEquals(title, "Error");
assertEquals(axeResults.getIncomplete().size(), 1);
assertEquals(axeResults.getIncomplete().get(0).getId(), "frame-tested");
assertEquals(axeResults.getIncomplete().get(0).getNodes().size(), 1);
assertTargetEquals(
axeResults.getIncomplete().get(0).getNodes().get(0).getTarget(),
new String[] {"#ifr-lazy", "#lazy-iframe"});
assertEquals(axeResults.getViolations().size(), 2);
assertEquals(axeResults.getViolations().get(1).getId(), "label");
assertEquals(axeResults.getViolations().get(1).getNodes().size(), 1);
assertTargetEquals(
axeResults.getViolations().get(1).getNodes().get(0).getTarget(),
new String[] {"#ifr-lazy", "#lazy-baz", "input"});
}

I have verified on Chomedriver 126 this issue doesn't appear. The intermediate workaround is to pass --headless=old as part of the chrome arguments which acts like the old --headless mode.

Follow ups include:

  • Identifying if this is considered an axe-core bug, running in headed or headless=new mode does not cause the #lazy-iframe to be part of the incomplete results for the frame-tested rule. Note that this doesn't appear to be an issue with Playwright and might be a limitation on Seleniums side and/or a behavioural difference about how the lazy iframes are loaded.
  • Once we've figured out a fix, we should go and update the test to account for the new changes and amend the headless flag to either the default behaviour or headless=new.
@dequejenn dequejenn added QA: required This ticket requires QA signoff web-apis labels Sep 26, 2024
@dequejenn dequejenn added the SIZE: medium Medium work effort label Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
QA: required This ticket requires QA signoff SIZE: medium Medium work effort web-apis
Projects
None yet
Development

No branches or pull requests

2 participants