Mainframe Automation Using UFT One

The mainframe is a very high-speed processing computer. It is even faster than supercomputers. However, supercomputers can solve complex algorithms faster than a mainframe computer. The mainframe runs on the z/OS operating system. Windows-based terminal emulators are used to connecting users to IBM Mainframe. There are various terminal emulators available like Extra! X-treme, BlueZone and Tuxedo, etc to connect IBM Mainframe.

Mainframe testing includes validation of online CICS screens and TSO ISPF screens. Any maintenance done on the CICS screen generates outgoing files and reports on the nightly batch. In this article, you will learn how to configure the terminal emulator to start mainframe automation using UFT now known as UFT One.

Click here to subscribe to MySkillPoint official YouTube Channel

How to start Mainframe Automation using UFT 

I am going to explain to you a very generic approach of Mainframe automation testing using which you can easily automate any kind of emulator-based application.

Mainframe Automation Prerequisites

Below is the prerequisite to automate the Terminal Emulator application.

  • Terminal Emulator application should be in an opened state
  • Terminal Emulator add-in must be associated with UFT
  • Terminal Emulator should be configured in UFT

How to Configure Terminal Emulator in UFT

We have to associate the Terminal Emulator add-in from the add-in manager at the time of opening UFT and follow the below steps.
 
Step1: Now create a new GUI Test in UFT and go to “Tools>Option>GUI Testing>Terminal Emulator“.
You will see the Options window to configure the Terminal emulator as per your requirement.
 
Terminal-Emulator-Configuration-UFT-1
 
Step2: Now you will have to select the required vendor name as shown in the following screenshot. If you are using an emulator for which the Vendor is not available then you will have to manually configure it using the Wizard option. If you want to know how to manually configure a terminal emulator in UFT please refer to my post on Terminal Emulator Configuration in UFT.
 
Terminal-Emulator-Configuration-UFT-2
 
Step3: After selecting the Vendor, select the Emulator appropriate version. There is one more option that is Protocol. There are two protocols (3270 and 5250). The mainframe uses either of them so keep the Auto-Detect option selected. Click the Validate button. If UFT is able to identify the emulator it will show you an OK message in green color against the Emulator field. 
 
Mainframe Automation using UFT
 
If you see the OK message then you are done with the Terminal Emulator configuration and now you can proceed further. You can record a test and playback it. If you are not sure what is your emulator’s Vendor name, you can select each vendor one by one and click on the Validate button until you get the OK message.
 
Mainframe automation is a bit different than the automation of other GUI-based applications.
 
mainframe CICS Screen automation UFT
 

Other GUI-based applications have lots of objects like TextBox, Button, List Box, Hyperlinks, Web table and radio button, etc. However, in the case of the mainframe or any emulator application, we have to deal with just four types of objects.

Test Object Description
TeField A terminal emulator field that fully supports HLLAPI.
TeScreen A terminal emulator screen that fully supports HLLAPI.
TeTextScreen A terminal emulator screen that uses text-only HLLAPI or does not support HLLAPI.
TeWindow A terminal emulator window.

Operations performed on a Mainframe Screen

UFT supports various methods to perform desired actions on a Mainframe screen. One can use the object repository for each object on a mainframe screen but that would not be a good approach because you have to maintain too many objects. Here I would recommend the best practices followed in the IT industry.

The entire mainframe screens can be automated by just using the following operations. We don’t need all the methods available on UFT for terminal emulator objects.

  • Set Text at a particular field or coordinate(row and column)
  • Get Text for a particular field or up to certain coordinates
  • Sending keys like ENTER, ESC, F1, F7, and F8, etc.
  • Using Sync method to wait for the next screen to load completely until it gets in ready state

Mainframe Automation Using UFT – Sample Code

The following example shows how we can set a text to a particular coordinate on a Mainframe screen. Also, it shows how we can retrieve text for the desired coordinates and how we can send the desired key on a Mainframe screen.

Please watch out the above attached video for more details and optimizing the automation test script code.

If you want to know best practices to automate the mainframe application please refer to the following video.

Click here to subscribe to MySkillPoint official YouTube Channel

Send Key List on Mainframe | Terminal Emulator

Key Mnemonic Script Constant
@ @@
PA1 @x TE_PA1
PA2 @y TE_PA2
PA3 @z TE_PA3
PA4 @+ TE_PA4
PA5 @% TE_PA5
PA6 @& TE_PA6
PA7 @’ TE_PA7
PA8 @( TE_PA8
PA9 @) TE_PA9
PA10 @* TE_PA10
PF1 @1 TE_PF1
PF2 @2 TE_PF2
PF3 @3 TE_PF3
PF4 @4 TE_PF4
PF5 @5 TE_PF5
PF6 @6 TE_PF6
PF7 @7 TE_PF7
PF8 @8 TE_PF8
PF9 @9 TE_PF9
PF10 @a TE_PF10
PF11 @b TE_PF11
PF12 @c TE_PF12
PF13 @d TE_PF13
PF14 @e TE_PF14
PF15 @f TE_PF15
PF16 @g TE_PF16
PF17 @h TE_PF17
PF18 @i TE_PF18
PF19 @j TE_PF19
PF20 @k TE_PF20
PF21 @l TE_PF21
PF22 @m TE_PF22
PF23 @n TE_PF23
PF24 @o TE_PF24
Alternate Cursor @$ TE_ALTERNATE_CURSOR
Attention @A@Q TE_ATTENTION
Backspace @< TE_BACKSPACE
Backtab @B TE_BACKTAB
Clear @C TE_CLEAR
Cursor Down @V TE_DOWN
Cursor Left @L TE_LEFT
Cursor Right @Z TE_RIGHT
Cursor Select @A@J TE_CURSOR_SELECT
Cursor Up @U TE_UP
Delete Character @D TE_DELETE
Dup @S@x TE_DUP
Enter @E TE_ENTER
Erase EOF @F TE_ERASE_EOF
Erase Input @A@F TE_ERASE_INPUT
Field Exit @A@E TE_FIELD_EXIT
Field Mark @S@y TE_FIELD_MARK
Field Minus @A@- TE_FIELD_MINUS
Field Plus @A@+ TE_FIELD_PLUS
Home @0 TE_HOME
End @q TE_END
Insert Character @I TE_INSERT
New Line @N TE_NEW_LINE
Print Screen @P TE_LOCAL_PRINT
Page Down @v TE_PAGE_DOWN
Page Up @u TE_PAGE_UP
Reset @R TE_RESET
System Request @A@H TE_SYS_REQ
Tab @T TE_TAB
Help @H TE_HELP
¢ (cent) @A@c TE_TEST
| (solid vertical bar) @A@v
Backward Word @A@z
Card Reader @W
Cursor Left Double @A@L
Cursor Right Double @A@Z
Device Cancel @A@R
Magnetic Slot Reader @Y
Forward Word @A@y

If you still have any queries, please write them in the comment box.

Recommended Posts

Leave a Reply