How to Target Java Elements When DPI Scaling is changed from 100%

I am using UiPath 23.12 Community with Windows 11 on 4K display.

Setting the windows System > Display > Custom scaling to something other than 100%, causes targeting of UI elements in Java application(s) to fail. Resetting the scaling back to 100% (requires logout and login), and targeting works again. In other words, Java elements cannot be selected.
This occurs in both Studio and UI Explorer.

I noticed a similar issue with SAP discussed in this forum

Can anyone provide a solution that addresses this issue?

@grosner

May I know why are you chnging it?

Ideally these can be controlled from the robot settings in orchestrator about how much resolution you need and all

Also using windowmessages pr etc would not wffect these changes as well

Cheers

1 Like

@grosner - Studio - Example of Using the ScaleCoordinates Migration Tool

This might helps.

DPI Scaling change is necessary in order to enlarge tiny fonts that show in Windows 11 dialog boxes.

In my case, the Java elements cannot be targeted with the design tools in 23.12 when Windows DPI Scaling is changed to something other than 100%.
Is it just me or has anyone seen this same failure to target elements behavior for their Java apps?

@grosner

if tat is the issue…we can use vbscript to edit the dpi before starting the process to 100%. would that work for you?

cheers

No that does not work because the fail occurs during the design phase not during the operational runtime phase.

As previously stated, the scaling of 125% - 150%, is REQUIRED TO SEE, with my own eyes, the NON UiPath screen elements (window dialogs, etc.) that cannot be made larger. Basically, the design process of selecting Java elements should work as well as selecting Window Browser elements regardless of the screen scaling.

@grosner

see its might not be an issue of selecting…try to change the resolution and then cahnge the dpi to see better and it should work

generally if 100% is not set also the elements are seen the sme way so may be hovering at a different place might trigger the elemnt to be detected…to amange we change the resolution by maintaining 100% dpi

cheers

Here are the steps to reproduce the inability to target Java elements when Windows 11 resolution is anything but 100%:

  1. Change Windows 11 DPI Scaling: System > Display > Scale: 125%
  2. Sign out and back in to Windows 11
  3. Launch your Java app.
  4. Launch UiExplorer
  5. Click to Indicate Element:
  6. Move mouse to any Java element. You cannot select the element.
  7. Revert Scale to 100% and follow steps 2 thru 6 and you can select the element.

I hope this helps UiPath duplicate and fix this issue.

Anil_G - Thank you for your attempt to help, but changing to 100% so things start working again does not address my initial question or my need. What we need is for UiPath and UiExplorer to work with Java to target selectors, regardless of the windows scaling.

By carefully following these Extension For Java UiPath instructions I was able to get my my application to work with Windows 11 DPI scale at 125%.

The final step was to add these two lines to my .vmoptions file and that made things finally work. Note that I adapted the settings from the recommended ones to the following:

-Dsun.java2d.uiScale.enabled=true
-Dsun.java2d.uiScale=100%

Thanks to everyone for pointing me in the right direction!

2 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.