My current project involves conducting accessibility testing using the Axe-Core tool with Java as the programming language. While I have successfully obtained results from many pages in my application, I encountered an error on one specific page:
org.openqa.selenium.JavascriptException: javascript error: eval is disabled
(Session info: chrome=81.0.4044.138)
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'XXXX', ip: 'XXXX', os.name: 'Windows 10', os.arch: 'amd64',
os.version: '10.0', java.version: '1.8.0_131'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 81.0.4044.138, chrome:
{chromedriverVersion: 81.0.4044.138 (8c6c7ba89cc9..., userDataDir: C:\Users\NASEEM~1.AHM\AppDa...},
goog:chromeOptions: {debuggerAddress: localhost:52030}, javascriptEnabled: true,
networkConnectionEnabled: false, pageLoadStrategy: normal, platform: WINDOWS, platformName: WINDOWS,
proxy: Proxy(), setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0,
pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify, webauthn:virtualAuthenticators: true}
Session ID: cbdfe9de190b8224da1ec675bef90966
The error occurs within the following code snippet:
JSONObject responseJSON = new AXE.Builder(driver, scriptUrl).analyze();
This issue specifically arises when running the test in the Chrome browser. Surprisingly, when executing the same code in Firefox, it runs smoothly without any hiccups.
Is there anything else that I should consider adding while running the test? Are there any desired capabilities that I need to include?
Your suggestions would be highly appreciated.