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
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?
First of all Try below mentioned screen shot properties!
And you can also try using Classic Type into activity by simply opening Activity Panel → Filter Icon → Atlast Tick Classic.
Add Classic Type Into Activity with below mentioned properties:
Expand Target Category:
Select WaitForReady.Complete
and all the ticks mentioned in the screenshot.
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.