Robotic Process Automation (RPA)

Robotic Process Automation (RPA)

Come for answers. Stay for best practices. All we’re missing is you.

 View Only
  • 1.  Send Keys returns "Access is Denied" when RDP Session is inactive - IBM RPA

    Posted 07/16/26 12:54 PM

    Hello IBM RPA Community,

    I'm facing an issue with IBM RPA where Send Keys command 
    returns "Access is Denied" when the RDP session becomes 
    inactive or the screen locks.

    Environment:
    - IBM RPA Studio 23.x
    - Windows Server (Bank environment)
    - Running scripts via RDP on Jump Server

    Problem:
    When the RDP session goes inactive, any Send Keys command 
    fails with the following error:

    System.Exception: Access is denied
    at WDG.Automation.Runtime.Desktop.AutomationDriverInputs.SendKeys
    at WDG.Automation.Runtime.Desktop.SendKeysCommand.Execute(WindowsContext context)

    Additional Issue:
    terminalSshConnect command always shows 
    "Terminal is disconnected" even with correct credentials.
    The SSH server has a login Banner which may be causing 
    the disconnect.

    Workaround found:
    Using executeSSH with nohup & disown instead of 
    terminalSshConnect works successfully.

    Questions:
    1. Is there a way to use Send Keys without requiring 
       an active Windows session?
    2. Is terminalSshConnect affected by SSH server banners?
    3. What is the recommended approach for Unattended 
       robots that use Send Keys?

    Thank you



    ------------------------------
    Ahmad El sheikh Ali
    ------------------------------


  • 2.  RE: Send Keys returns "Access is Denied" when RDP Session is inactive - IBM RPA

    Posted 07/17/26 07:13 AM

    Hi Admad.

    Regarding the sendKeys issue, are you trying to send the command to an application on the same VM where IBM RPA is running, or does that VM establish an RDP connection to another VM, and are you trying to send the command to that other RDP session?

    As for the terminalSshConnect issue, it simply connects to the terminal, so I don't think a banner would cause the connection to fail. But I don't understand how the executeSSH  command would solve anything. After all, if IBM RPA isn't connected to the terminal, how would executing a command (sending something to the same terminal where the connection failed) solve the problem? Does this message "Terminal is disconnected" appear in the terminal screen, or does the IBM RPA command fail with this error message? Do you have any screenshots or logs (preferably at the INFO level)? Which version of IBM RPA are you using?



    ------------------------------
    Tarcio Alonso Mota
    Sr. Software Developer
    IBM
    ------------------------------



  • 3.  RE: Send Keys returns "Access is Denied" when RDP Session is inactive - IBM RPA

    Posted 07/17/26 01:00 PM

    Hi Tarcio,

    Thank you for your response. Please find my answers below:

    1. Regarding Send Keys Issue:
      IBM RPA is running on the Jump Server itself, and Send Keys 
      is targeting an application on the same Jump Server.
      The issue occurs when the RDP session to the Jump Server 
      becomes inactive or locked.
      Please see Screenshot 1 for the exact error.
    2. Screenshot showing IBM RPA Studio error dialog on line 835.  The error message reads:

    2. Regarding terminalSshConnect vs executeSSH:
    - SSH Login command works successfully and returns 
      a valid SSH connection object.
    - Connect to Terminal via SSH always shows 
      "Terminal is disconnected" immediately, 
      even with correct credentials (Server, Username, 
      Password, Port ).

    • Please see Screenshot 2 for the Terminal window 
        and Screenshots 3 & 4 for both command configurations.
    • Screenshot showing IBM RPA Studio Terminal window (Designer view)  with a red message at the top:
    • Screenshot showing IBM RPA Studio SSH Login command configuration.  Input Parameters: Server (hidden), Username (hidden), Password (hidden),  Port (hidden), Private Key empty, Pass-Phrase empty, Timeout empty.  Output: SSH Connection variable named Screenshot showing IBM RPA Studio

    The difference is:
    - terminalSshConnect → Opens Terminal Window inside 
      IBM RPA Studio → Always disconnected ❌
    - executeSSH → Sends commands directly via SSH 
      without Terminal Window → Works successfully ✅

    3. Regarding the Terminal is disconnected message:
    This message appears inside the IBM RPA Terminal 
    window in the Designer view, not in the script logs.

    IBM RPA Version: 30.0.2

    Thank you for your support.


    Ahmad El Sheikh Ali



    ------------------------------
    Ahmad El sheikh Ali
    ------------------------------



  • 4.  RE: Send Keys returns "Access is Denied" when RDP Session is inactive - IBM RPA

    Posted 07/17/26 02:17 PM

    That's strange.
    How did the Windows session go idle if the automation is running?
    As long as something is happening on the computer, Windows won't lock the session.
    But anyway, if the session is locked, IBM RPA really won't work, because any action that IBM RPA sends to Windows won't be processed, since the session is locked.

    As for the terminal, I understand now.
    Try using a different value for the --cursorkeysstate parameter. If that doesn't work, then it might be a bug.
    I don't know why there are two commands for accessing SSH server, but I've noticed that they use different components.
    Perhaps one of them is designed for a specific type of SSH terminal.
     https://www.ibm.com/docs/en/rpa/30.0.x?topic=connection-connect-terminal-via-ssh

    Na verdade



    ------------------------------
    Tarcio Alonso Mota
    Sr. Software Developer
    IBM
    ------------------------------



  • 5.  RE: Send Keys returns "Access is Denied" when RDP Session is inactive - IBM RPA

    Posted 07/17/26 03:36 PM
    Hi Tarcio,
    
    Thank you for your response.
    
    1. Regarding the session lock:
    To clarify the Send Keys issue further - the script actually 
    works fine when running from the Control Room (Unattended mode).
    
    The problem only happens in this specific scenario:
    - I connect to the RPA machine via Remote Desktop (RDP)
    - I run the script manually from IBM RPA Studio
    - The RDP session disconnects or goes idle during execution
    - At that point, Send Keys fails with "Access is denied"
    
    The reason the session goes idle is that the script was 
    waiting for a long-running SSH process to complete 
    (could take 1-2 hours). During this wait, there is no 
    UI interaction happening, so Windows locks the RDP session.
    
    So the root cause is that Send Keys loses its Windows context 
    once the RDP session is disconnected or locked.
    
    2. Regarding terminalSshConnect:
    I have already tried both "Normal" and "Application" values 
    for --cursorkeysstate but the result is the same 
    "Terminal is disconnected" in both cases.
    
    I will check the documentation link you shared.
    Could this still be a known bug in version 30.0.2?
    
    3. Additional question:
    Have you ever faced a situation where you are working on 
    a Desktop automation project and you try to capture a 
    specific UI element using the Recorder, but the Recorder 
    simply cannot see it?
    
    For example:
    - A button that the Recorder does not detect
    - An input field that is invisible to the Recorder
    - The element exists on screen but the Recorder 
      cannot capture it at all
    
    If yes, what was the reason and how did you solve it?
    
    Thank you for your support.


    ------------------------------
    Ahmad El sheikh Ali
    ------------------------------



  • 6.  RE: Send Keys returns "Access is Denied" when RDP Session is inactive - IBM RPA

    Posted 07/17/26 04:02 PM

    1. SendKeys
    This is completely normal and expected behavior.
    What you can do is configure your VM not to lock the Windows session or increase the time before it locks.
    From an IBM RPA perspective, there's the preventSleep command, which runs in the background and constantly moves the mouse pointer to try to "bypass" Windows' idle control. It's not 100% guaranteed to work, but it's worth a try. 
    In my opinion, the best approach is still to change the Windows policies to disable session lock or increase the time before the session locks.

    3. UI Recorder
    There are a few possibilities.
    If your application runs with administrator privileges, IBM RPA Studio will not be able to locate the elements in that application's window.
    In that case, you would need to run Studio with administrator privileges as well to gain "access" to the elements of that application.
    To run the robot via Control Center, you'll need to configure WDG.Automation.AgentHost.exe to run with administrator privileges as well, so that it has access to your application's windows.

    UI automation depends on the application having a layer that allows for this integration.
    For security reasons, some applications do not provide the information needed for automation to work (e.g., Chrome security pop-ups). 
    Other applications are built using development frameworks that also "hide" elements programmatically (e.g., an element is only "accessible" when it receives focus).

    There are other factors as well.
    For example, if you have a Java application and the app's window is highlighted in green on Recorder instead of red.
    In that case, you need to enable the Java Access Bridge (another link) on your VM.



    ------------------------------
    Tarcio Alonso Mota
    Sr. Software Developer
    IBM
    ------------------------------



  • 7.  RE: Send Keys returns "Access is Denied" when RDP Session is inactive - IBM RPA

    Posted 07/18/26 07:13 PM
    Hi Tarcio,
    
    Thank you for the detailed and helpful response.
    
    1. Regarding Send Keys:
    That makes sense now. I will try the preventSleep command 
    as a quick fix, and I will also request the IT team to 
    configure the Windows session lock policy on the RPA server 
    to prevent it from locking during long-running processes.
    
    2. Regarding UI Recorder:
    My application is a WPF desktop application. I will try 
    running IBM RPA Studio with administrator privileges and 
    test if the Recorder can detect the elements.
    
    I will also configure WDG.Automation.AgentHost.exe to run 
    with administrator privileges for the Control Room execution.
    
    I will update this thread with the results.
    
    Thank you again for your time and support.
    


    ------------------------------
    Ahmad El sheikh Ali
    RPA Developer | RPA - Robotic Process Automation
    ValleySoft
    Kafr El Sheikh, Riyadh Center, Al-Hajj Youssef Vil
    01024285083
    ------------------------------



  • 8.  RE: Send Keys returns "Access is Denied" when RDP Session is inactive - IBM RPA

    Posted 07/30/26 09:03 AM

    I don't know if Sofia has spoken with you, but we have an issue in version 30.0.2 that affects the terminalSshConnect command.

    Updating to version 30.0.3 might resolve this issue.



    ------------------------------
    Tarcio Alonso Mota
    Sr. Software Developer
    IBM
    ------------------------------