This issue is related to not giving permission for terminal to control things in System Preferences -> Security & privacy -> Privacy -> Accessibility.
I have verified the test in our CI and removed it from problemlist. There are small tweaks in test also. ------------- Commit messages: - 8233562: [TESTBUG] Swing StyledEditorKit test bug4506788.java fails on MacOS Changes: https://git.openjdk.java.net/jdk/pull/1028/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=1028&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8233562 Stats: 4 lines in 2 files changed: 1 ins; 2 del; 1 mod Patch: https://git.openjdk.java.net/jdk/pull/1028.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/1028/head:pull/1028 PR: https://git.openjdk.java.net/jdk/pull/1028