Skip to content

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

Open
@Zidious

Description

@Zidious

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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions