I’m working with a Terminal session using the SCO ANSI provider in UiPath and facing an issue with the Send Keys activity.
When I hardcode a string value in Send Keys (e.g., "123456"), it types correctly in the terminal.
But when I pass a variable (e.g., varValue = "123456"), nothing is typed in the terminal screen.
I’ve made sure:
The variable is of type String
I’ve used .ToString.Trim() to clean it
Added a Delay before the Send Keys activity
Still, the terminal input doesn’t happen when the value is from a variable.
Is there a solution or a any alternate way to achieve it (like send keyboard shortcut however it requires to Indicate the target application right in Terminal case we cannot)
First point
where you placed that value assigning into variable, is it before of the send keys activity.
debug the code and add a break point on send keys activity and when execution came to breakpoint, ensure that variable having the value or not from local or immediate panels.
if it comes null that means your variable not storing the value so need add the value or any scope differences check those and make it correct.
use terminal send activity to send the variable text directly ensure the terminal is focused avoid send keys with variables if needed try changing input method to sendwindowmessages or use set text with clickbeforetyping enabled