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

Getting Error while calling analyze method java.lang.RuntimeException: Error when removing sandbox from iframes in Selenium with java

lakshminagandla opened this issue · comments

Software dependency versions used:

com.deque.html.axe-core : 4.0.0

Calling methods:

When we call the method : Results result = builder.withoutIframeSandboxes().analyze(driver)

and

Results result = builder.analyze(driver)

Error that we are getting:

"java.lang.RuntimeException: Error when removing sandbox from iframes"

Note: For few of the other applications, the Analyzer method is working as expected. But on few applications, throwing above exception message.

Here we can see the code that we have used:

File file = new File("src/main/resources/axe.min.js");

	String path = file.getCanonicalPath();
	
	AxeBuilder builder = new AxeBuilder();
	 
	String timeoutFilePath = "src/main/resources/axe.min.js";
	 
	FileAxeScriptProvider axeScriptProvider = new FileAxeScriptProvider(timeoutFilePath);
	 
	builder.setAxeScriptProvider(axeScriptProvider);
	 
	Results result = builder.analyze(driver);
	 
	List<Rule> violations = result.getViolations();
	 
	Assert.assertEquals(0, violations.size(), "No violations found");

Can any one please check share what exactly issue with AXE or application side?

Hi @lakshminagandla. I'm trying to reproduce your issue and having trouble. Can you check if this is still an issue? If it is, can you tell me the URL you are trying to test? The exception you are getting is due to the javascript we use to remove sanboxes throwing an error. We are wrapping the underlying exception in a RuntimeException, so the root cause should still be shown in the stack trace. Can you post that? It should provide insights into what is going wrong for you.

@lakshminagandla closing this issue. Please feel free to re-open if necessary.