How to inspect PyCharm IDE's UI elements by Windows Accessbility Insights

Hi, I'm trying to write a UI automation script for my JetBrains plugin and I need to get PyCharm's UI elements to produce some actions(like right clicking code window, click elements in the right-click menus or click buttons in my plugin windows). 

But when I try to open Windows Accessibility Insights to inspect the UI element tree I found that I can just catch the PyCharm window itself, but I cannot inspect any element in the IDE (like editor, buttons or texts).

So what I want to know is, if I want to write some UI automation scripts, how can I inspect the UI elements infomation in PyCharm?

 

What I have tried:

1. Open Settings-Apperance-Support screen readers: not work. 

2. Enabling Internal Mode: now I can get the UI elements by Internal Actions – UI Inspector, but I still can't use them to write UI automation script since my UI automation code still can't click or recognize them.

 

In VSCode I passed a parameter --force-renderer-accessibility and it's works for VSCode. But maybe it's because VSCode is written by Electron and this parameter can unlock the webview randerer accessibility. I don't know if there's a similar way in PyCharm.

In addition, I can get the UI elements in Mac version of PyCharm.

0

Maybe I have found the answers.

1. JetBrains uses Java Swing framework to write frontend interface, which means it needs Java Access Bridge (JAB) to access the UI elements. In FAQ for Accessibility Insights for Windows they said that Accessiility Insights cannot scan Java application which requires JAB.

Can I use Accessibility Insights for Windows on a Windows app written with Java?

If the Java framework produces controls which support Windows UI Automation (UIA) provider interfaces, you can use Accessibility Insights for Windows to scan the Java application. Frameworks known to support UIA are JavaFX and QT (although there may be others). However, if the application is built using a framework that requires the Java Access Bridge for accessibility (such as Swing), Accessibility Insights for Windows will not be able to scan the application.

2. To write UI automation for Java Swing applications, we can use UI automation framework which supports JAB, or packages which can use JAB APIs, like FEST-Swing/AssertJ-Swing/PyJAB/...

3. Looks like that JetBrains has their own UI automation tools( https://github.com/JetBrains/intellij-ui-test-robot ).

0

请先登录再写评论。