Hi Vinicius,
Thank you for your suggestion.
I actually found a workaround. I split the command into three parts, adding a 1-second delay between each command. Notably, in the second part (where the password is sent), I used the --ignorespecialcharacters
flag to handle special characters properly. Here's what worked for me:
sendKeys --keys "sshpass -p " --viacurrentwindow
delay --timeout "00:00:01"
sendKeys --keys "\"${password}\"" --viacurrentwindow --igndorespecialcharacters
delay --timeout "00:00:01"
sendKeys --keys " ssh ${username}@${ip}~" --viacurrentwindow
This approach ensures a smooth execution. Hope this helps others facing a similar issue!
------------------------------
Muhammad Mahfouz
AI & Automation Engineer | Applied Data Scientist
Telecom Egypt
------------------------------
Original Message:
Sent: Mon February 10, 2025 06:36 PM
From: Vinicius Marques
Subject: Handling Special Characters in Passwords When Using SendKeys in IBM RPA
Hi Muhammad!
I suggest you open a ticket with the support for them to investigate the issue. Here's the page: https://www.ibm.com/mysupport
Until then, does using the Type Text command work? Another possible workaround is sending the values to the clipboard using Send to Clipboard and then Paste from Clipboard (need to ensure the window is focused).
------------------------------
Vinicius Marques
Data Engineer
Music.AI
Rio Grande
Original Message:
Sent: Sat February 08, 2025 05:38 PM
From: Muhammad Mahfouz
Subject: Handling Special Characters in Passwords When Using SendKeys in IBM RPA
I am using IBM RPA to automate an SSH login process using the SendKeys command. While executing the following command:
sendKeys --keys "sshpass -p ${password} ssh ${username}@${ip}~" --viacurrentwindow
I encounter the error:
"System.Exception: Group delimiters are not balanced."
However, when I use only:
sendKeys --keys "ssh ${username}@${ip}~" --viacurrentwindow
it works fine. I suspect the issue is related to the password variable (${password}
), which contains special characters.
How can I properly send the full SSH command, ensuring that IBM RPA correctly handles special characters in the password?
Note:
When I enabled ignore special character option, it also didn't work.
------------------------------
Muhammad Mahfouz
AI & Automation Engineer | Applied Data Scientist
Telecom Egypt
------------------------------