According to the system documentation, QuickTest Professional supports a number of terminal emulators, the vendors including Attachmate, Hummingbird, IBM, NetManage, Seagull, WRQ and Zephyr. However there are a myriad of other vendors out there with terminal emulators that could manually be integrated with QTP. This document will go through the setup of one of these, namely the TN3270 Plus emulator.

However all emulators should work in more or less the same way. For the purposes of this example we will be using the Mercury Terminal Demo Server application. Note that in order to get the most benefit from the integration to QTP, the emulator must be based on HLLAPI, or variations thereof. This will enable QTP to recognize fields as objects and record them in the repository. The TN3270 Plus emulator uses WinHLLAPI.dll. In this example I am also assuming that the TE Add-in for QTP has been installed.

The process is relatively simple:
1. Install the terminal emulator. A trial version of the TN3270 Plus emulator can be downloaded from sdisw. After installing the emulator I started the Mercury server and opened a terminal window.

View of emulator connected to the Mercury Demo Application

2. The next thing we need to do is set up the session in the emulator. Do this by going to Setup => Sessions. At the bottom right there is the WinHLLAPI Session ID. Change this to “A”. All other settings I just left at their default values.

Define "A" session in emulator

3. Open QTP. Note that it is important that the emulator application is opened before QTP is opened, else QTP will not hook in to the emulator. Open the menu Tools => Options. Select the Terminal Emulator section. Click the Open Wizard button to start defining the emulator settings.

4. Click Next on the first page. Select the Configure a new user-defined setting option and enter a descriptive name for Vendor and Emulator. Click Next, Next.

Define a new emulator type.

5. Browse to the file that is used by the emulator (In this case it is “C:\Program Files\SDI\TN3270 Plus\Whllapi.dll”). The name of the file will be something along the lines of hllapi.dll, whllapi.dll, ehllapi.dll or ehllapi32.dll, etc. depending on the vendor used. Secondly we need to specify the name of the entry function for this dll file. This may be less obvious. If it is not documented you can get the info by interrogating the dll with a tool such as Dependency Walker. In our example, the name of the function is simply hllapi. Note that the function names are case sensitive. Lastly we select Classic as the HLLAPI format. Click Next.

Define HLLAPI dll details

6. You should now be presented with a preview window displaying the contents of the emulator screen. If you don’t see this it means that QTP is not able to connect to the emulator. Reasons may include an incorrectly-defined function name, emulator session not set to “A” or QTP having been opened before the emulator.

Confirm QTP connectivity to emulator

7. Next we need to point out the different screen components of the emulator window to QTP. Click the “hand” button for each one and then click the area of the window that you want to register. You should not need to configure the emulator screen (bottom checkbox), unless you are not using hllapi. Click Next.

Register emulator window components in QTP

8. Finally, you can save the configuration settings to a file if you want. Click Finish to complete the process. You should now be able to script against the emulator, with QTP recognizing fields and registering them in the repository. In some cases the fields are not registered automatically so you may have to add them to the repository manually. You can now do anything that would normally be able to do with a Windows app using the repository, such as checkpoints or using the GetROProperty methods.

Happy scripting!

Example of script recorded against emulator example

15 comments on “Integrating QTP with Terminal Emulators

  1. Hello

    Greetings for the day..

    can some one help me in this. I need QTP automation code for AS400 application. below is the step by step process of what area i need a automation code. please help me on this… thaks for your time.

    The following steps are required to test the Stage & Load of Eligibility files:
    STEP 1: Before starting Eligibility Regression, Tester needs to verify the following access:
    1. To check if user have access in UAT Book 1 APSI8041 Environment.
    2. To check FTP access to copy in & out of libraries
    Note: First copy file (CPYF) from one library to another. You should be able to copy file. If nothing is copied, user needs to request FTP access via ITG.
    3. To check Stage (Menu Path CCT700, 2, 1, 2)
    4. To check Load (Menu Path CCT700, 2, 1, 3)
    Step 2: Copy file from one library to another library:

    For Example: Use CARRIER as: PSI2460
    1. From CCT600 > Type CPYF on command line.
    2. FROM FILE :Enter PSERSTST81
    3. Copy file from STELLALIB library
    Note: Make sure the Current File Name and Current Library Name are entered.
    4. TO FILE: Enter PSI2460MBR
    5. To library: NWRXLIB
    6. Replace or add records: Type *REPLACE
    7. Press F10=Additional Parameters
    8. Press page down untill Record format field mapping: Type *NOCHK
    9. Press Enter
    Step 3: To Perform Eligibility File Loads:
    To check the Stage of Eligibility files:
    1. From Command Line type CCT700 > 2. Batch Transaction Loads > 1. Perform Eligibility File Loads > 2. Eligibility Stage
    2. For Carrier: Use Carrier as PSI2460
    3. Enter Stage Option as ‘S’
    4. After Press F6=Submit to Batch
    5. Type WSJJ on command line to search for Submitted Jobs
    6. Enter Option 2=Change
    7. To change JOBQ status to OUTQ status Type JOBQ (ELIGLOAD) on command line.
    8. Hit F5 untill status changed to OUTQ.
    9. After Hit Enter
    10. Take job with Option 5=Work with
    11. Enter option 4. Work with spooled files for Display Job Inline Data Files
    12. Take RXELGMER with 5=Display for Display Spooled File
    13. To check Members Input data as same as Members Accepted data.
    Step 4: To check the Load of Eligibility files:

    1. From Command Line type CCT700 > 2. Batch Transaction Loads > 1. Perform Eligibility File Loads > 3. Eligibility Load
    2. For Carrier: Use Carrier as PSI2460
    3. After Press F6=Submit to Batch
    4. Type WSJJ on command line to search for Submitted Jobs
    5. Enter Option 2=Change
    6. To change JOBQ status to OUTQ status Type JOBQ(ELIGLOAD) on command line.
    7. After Hit Enter
    8. Hit F5 untill status changed to OUTQ.
    9. Take job with option 5=Work with
    10. Enter option 4. Work with spooled files for Display Job Inline Data Files
    11. Take RXELGMER with 5=Display for Display Spooled File
    12. To check Members Input data as same as Members Accepted data
    Step 5: To verify the File will stage & load successfully under UAT RxCLAIM UserID:

    1. From Main menu: CCT600>1. Eligibility/Claim Transaction > 2. Member
    2. Enter the Member 10906527
    3. Take the Member with 5=Display
    4. Captured after the screen and place the below of the before screen
    5. Verify the Changed date and User information as Excepted.
    NOTE: same process can be repeated by using different carrier.

  2. Kash, it may be because you don’t have local admin rights on your PC? As far as I am aware it will save those setting locally.

    Unfortunately I don’t have the installs for the Demo Terminal Server application. It may be possible to request it from HP?

  3. But when For each and every time i start QTP i have to configure this settings again and again.Do we have any solution for this ?

    Could you please send me or post answer

  4. Hi ,
    I want to use the demo application, but I can’t find it can you send me it or tell me where I can find it?

    Regards,
    Guru

  5. Hi ,
    i want to use the demo application but i can’t find it can you send me it or tell me where i can find it ?

    Best regards
    Luca

  6. Hi,
    I want try to use this add-in but i can’t find the Mercury application that you have use.
    Can you tell me where you find it ?
    or better can send it to me ?
    Luca

  7. Hi ,
    I interfaced QTP with the mainframe application(TN3270) .But when For each and every time i start QTP i have to configure this settings again and again.Do we have any solution for this ?

  8. Hi,

    I would like to try QTP with Terminal Emulators. Based on your example, you used Mercury Interactive Demo System. Does this application come with the QTP installation? If not, where can I download this demo application?

    I was trying to follow Step 1 but doesn’t know how to start Mercury server. Please let me know how to do that.

    Thanks,
    Erick

  9. Hi,

    This is an amazing documentation for someone who wants to start the automation of bluescreens. This helped me a lot. Thanks for the great work done!!!!

    Keep it up…..

    Madhu R

Leave a Reply