Thomas Sasnett (ThomasSasnett)
Lead Robotics Architect
Pegasystems Inc.
ThomasSasnett Member since 2016 11 posts
Posted: November 18, 2016
Last activity: November 22, 2016
Posted: 18 Nov 2016 16:11 EST
Last activity: 22 Nov 2016 5:34 EST

Text Adapter Navigation Suggestion

For most automations involving text adapters (AS400 or other terminal sessions, AKA "green screens"), you will need to create an automation that returns you to a known screen. The easiest way to do this is with a combination of the NewScreenShowing event and a script to get the screen you are currently on. In the example below, I have a forLoop that will try up to 20 times to navigate back to the scrBaseMenuOption screen. The 20 figure is arbitrary and yours may be lesser of greater depending on how many screens deep you may get into an application. The necessary script is below along with an image of the automation and the references required for the script.


Name: FindScreen

Parameters: OpenSpan.Adapters.Text.Host.IBM.PComm.WinHllapi.PCommWinHllapiAdapter adapter, out OpenSpan.Adapters.Text.Automation.Screen screen

Return: bool


screen = null;

if(adapter != null)


                foreach(OpenSpan.Adapters.IControl ctrl in adapter.Controls)


                                screen = ctrl as OpenSpan.Adapters.Text.Automation.Screen;

                                if(screen != null)



                                                                return true;




return false;





Robotic Process Automation
Moderation Team has archived post, This thread is closed to future replies. Content and links will no longer be updated. If you have the same/similar Discussion, please write a new Discussion.