QA/Execution/Web Testing/Automation/Screen Tutorial
Screen Tutorial
Quick Guide
"screen" - start a new screen session. The -S <name> flag names the session. The default name (when flag is omitted) is an ID number.
"screen -ls" - see a list of the active/detached screen sessions.
"screen -r <name>" - Reattach screen session with name <name>, as seen in "screen -ls"
Control+A => D - detach from current screen session
Control+A => K - kill current screen session (terminates any processes, etc)
Full Guide
We will be using the UNIX "screen" utility for managing the various RCs and other shell tabs on the OSX Grid machines.
For an indepth guide on screen and its features, go to [1].
Here's a quick rundown:
Using screen will mean that we can start and stop RCs/etc using an SSH session rather than having to VNC into a machine and physically closing / restarting a Terminal tab. Furthermore, we will no longer have to keep terminal windows open on the machines. RCs will run in the background.
To start a new screen session, type "screen" in terminal. I suggest giving it a name so that when you look at the active sessions, it makes sense. This can be done with the -S flag, so something like "screen -S selenium_grid" would be good.
This will clear your terminal window as if you just opened a new tab. You can now proceed as if it was a new tab (start RCs, etc).
When done starting the RCs, press control+a (this indicates you want to send a command to SCREEN rather than to the terminal window you're in), and then hit d - this will "detach" the screen session and leave it running in the background.
Detached screen sessions can be seen by typing "screen -ls".
To bring back detached screen sessions, type "screen -r <session_name>" and it will bring you back to the terminal window as you left it when you detached.
You can have multiple screen sessions running (just remember to detach before starting a new one), so this is perfect for running multiple RCs.
To kill a session, reattach it and use Control+A, then K.