Set Text Not Working Correctly In Java App

I use Get Text activity to read text from a Java viewport window.

However, even though the Set Text activity for the same UiElement is clearing the contents of the target UiElement (javax.swing.JTextPane), it is not writing any of the new content I specify in the Text argument of the UiPath.UIAutomationNext.Activities.NSetText activity.

I also tried using Set Web Attribute activity and this also cleared the UiElement (an editor window) but did not write any of the text.

How can i write text back to the same text attribute that I read from with Get Text?

Additional Info
Environment: Win 11, Studio 2024.2.1, C# Windows project, UiPath.Automation.Activities 24.2.2 preview.

Java state:
enabled,focusable,visible,showing,focused,editable,multiple line

if the text is editable, you can try Type Into

Type Into activity works but is far too slow for my needs:

  • Type Into sends one character at a time.
  • Type Into only works for me with some Input modes including:
    • Same as App/Browser
    • Hardware Events
    • Window Messages
    • Other input methods exhibit same behavior as Set Text (described above)

I’m guessing that Set Text uses the Input Method of Simulate which clears the input field without entering any of the text (the same thing happens when using Type Into with the Simulate input method).

As an alternative I can paste from clipboard, which is faster.

In short, Set Text should have selectable input methods if that is the reason it is not working for Java applications.

Has anyone had any success with Set Text when used with a Java editable text field?

Hey @grosner,

First of all Try below mentioned screen shot properties!
image

And you can also try using Classic Type into activity by simply opening Activity Panel → Filter Icon → Atlast Tick Classic.

image

Add Classic Type Into Activity with below mentioned properties:
Expand Target Category:
Select WaitForReady.Complete
and all the ticks mentioned in the screenshot.

Try All the above mentioned steps, I hope it will resolve your issue!

Regards,
Ajay Mishra
RPA Developer

Thank you for your detailed response.

Unfortunately, with my Java app, the Type Into (classic and modern), using Simulate with the other settings you suggest, only clears the editable text UiElement and DOES NOT write any new text.

Instead of Type Into or Set Text, I am using keyboard shortcuts to paste text from the clipboard and this is working.

Hi @grosner ,

Please send me a log file when you run the activity. To retrieve the logs, you can use DebugView - Sysinternals | Microsoft Learn.

You have to set an environment variable called UiPath_LOG_LEVEL and set its value to VERBOSE to be able to capture the low level logs of the Robot.

The behavior seems strange and it worth investigating it.

It would be awesome if you could send also the workflow file you use so we can take a look at the selectors and the properties of the activities.

You can send all the files to vlad.coteanu@uipath.com

Thanks.

I have emailed you the requested info.
Thank you for looking into this issue.