Possible to “attach to” mainframe terminal?

Is it possible to “attach to” an already open mainframe terminal, similar to how we attach to an open web browser, and then start entering mainframe transactions, or must we always start by opening the terminal and signing in, etc?

Using Rocket BlueZone, if that matters.


Have you tried using the “Attach Window” activity? I haven’t tried this with Rocket BlueZone specifically but this allows you to attach to most windows.

Thanks. That was floating around in my mind… but haven’t tried it yet. I was thinking maybe there is some kind of magical glue in a Terminal Session that can’t be broken. Going to try it now.

Nope. That doesn’t work. After attaching and trying some activities, I get an error “terminal not connected”

Hello, so you are saying your terminal will be already opened and logged in? Yes it is possible and you can use, as it is one way to approach it, reading the screen and working with string manipulation.

Yeah I know we could visually scrape something… but we need very robust & fast full capabilities for data input of many records. I wouldn’t want to introduce a scraping layer into this. Need direct interaction with the terminal window.

1 Like

as of now , and i was using as400 I was able to use it wiithout logging. I know scrapping sounds like a last resource, but im not saying image scrapping, and I deployed liked 250 machines with scrapping with 99.99 percent of success. let me know

What specifically does “reading the screen” mean, then? Which activity?

From what I can see… any activity that can be used to read text on the terminal must exist inside a “terminal session” activity, which will force a new mainframe window to open, which of course requires a login.


I ran into this issue the other day while streamlining our terminal components, mainly being able to access the text and perform actions on the screen in order to close out of the screens and window so a new terminal connection can be made.

There was no way to attach a terminal connection to an already opened window. However, you should be able to create a new terminal connection and pass the connection variable to other Terminal Session activities.

So my answer is for if the terminal window is opened prior to the job running, which then you will need to use some workarounds to close the window (assuming you can’t just hard kill the window).

Basically, I used a combination of the below:

Element Exists // to check if an instance of the terminal window is opened
Text Exists // to verify you are on a specific screen in the terminal window
Sent Hotkey // to perform navigation of the screens
Type Into // to perform actions on the screen
and Close Window

I placed all this in a Retry Scope, so I can close all terminal instances that are opened. Once there are no instances, then the job will be able to start a new Terminal connection.

This might not be the ideal solution, but this was just some input based on my prior experience.

And, like I said, if your job starts a new Terminal Connection you should be able to pass its output variable to other Terminal Session activities; it works fine for me.


Thanks for that.

I wasn’t really concerned about closing the existing terminal window since they don’t seem to interfere with a new session created by UiPath. We were primarily hoping that UiPath would always be able to just latch onto the user’s already open terminal to perform mass transactions without having to persist credentials nor force the user to type credentials each time the bot runs.

Since this doesn’t seem to be possible, we’re going to request a terminal “service account” that UiPath can use to login to a newly spawned terminal window any time it runs, regardless of who’s running the robot.

Fair enough. My suggestion would be to have a different login id for the robot that runs so it can perform the transactions on a new connection each time you need to process them. Since there is no way to latch on to the existing terminal connection that was opened by the user, I’m not sure there is really a good workaround… because getting the text at certain coordinates would be difficult.

Hope you find the answer you need though. I’m not an expert enough to know for sure if you can configure your Session connection to latch on to the existing one or not.


If the bot is going to run non-stop, then u can use flow chart or state machine to keep iterating the situation again and again. hopefully this should work

the one problem i face with PCOM is there are 2 exe files opening PCSCM and PCSWS when a PCOM terminal is opened, during repeated open and close of PCOM application these .EXE get stuck and PCOM goes not responding easily

Hi @octechnologist,

You can do it by starting the Terminal Session (UiPath.Terminal.Activities.TerminalSession) and then setting the property OutputConnection to a local variable. However, I could only work with this variable adding a delay inside the Terminal Session block. Without the delay, the output variable would not be set (nothing).

After this, you can use this same Terminal Session activity as the “Attach to” one. Instead of setting the property ConnectionString, you will set the ExistingConnection (under Use Existing Connection) with your existent terminal connection.


Bruno Costa.

1 Like

Yep thanks. My question was about attaching to a terminal that was already open before the robot starts, like we can do with web browsers.

@brunoazev I have similar situation. trying to attach terminal session with the existing terminal session but the existing terminal session is opened as a internet explorer. is there any way we can connect to this one?

Please advise

Hi, Sorry for the delay.

I`m afraid I haven’t worked yet on such a scenario but hope the community may help with your question.
I would recommend you to add screenshots to exemplify your problem.


Bruno Costa.

Hi @Senthil_Pandian

Did you find a solution for this issue? In my case I could find only PCSCM in task manager and could not find PCSWS. However, you might find PCSWS.exe in attach window selector on Terminal session. It is bit confusing though.

I had to kill PCSCM process before starting a new session and it worked find all the time. !

Let me know, how did you resolve your issue.

Thank You

Hi @brunoazev
I am also trying to attach terminal session. When I start terminal session I assign OutputConnection to MainframeConnection variable as UiPath.Terminal.TerminalConnection type. Also I added delay activity as you mentioned for 5-10 seconds. I still get OutputConnection null. Do you have any sugesstion? Which version of terminal activities did you use? (Mine is v1.3.4)

Sorry Salamow, but this is a weird behavior in which I was lucky to figure out about the delay helping with it. Have you tried to increase the delay for more than 10 sec?

Hi @brunoazev,
Yes, I tried different timeout spans more than 10 sec but no hope. I achieved to use connection string as argument for another workflow but it starts the terminal from begining, not where I left.
Thanks though.

1 Like