Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create object visible (Terminal)

Status
Not open for further replies.

Xsi

Programmer
May 29, 2015
121
SE
I am very new to UFT,

I am currently is doing automation for MainFrame also Terminal emulation.

Path to exe file

"C:\Program Files (x86)\IBM\Personal Communications\"

this is my atempt below:

Code:
Public Sub CreateTerminal()


Function Terminal()

Dim qtApp 'As QuickTest.Application ' Declare the Application object variable
Dim qtTeOptions 'As QuickTest.TeOptions ' Declare the TE Options object variable

Set qtApp = CreateObject("QuickTest.Application") ' Create the Application object
qtApp.SetActiveAddins Array("TeWindow") ' Activate the Terminal Emulator Add-in
qtApp.Launch ' Start UFT
qtApp.Visible = True ' Make the UFT application visible
Set qtTeOptions = qtApp.Options.TE ' Return the TE Options object

' Configure the Terminal Emulator options

' Set global Terminal Emulator options (apply to all emulators)

qtTeOptions.ScreenTitleRow = 1 ' Set the screen title location
qtTeOptions.ScreenTitleCol = 1
qtTeOptions.ScreenTitleLength = 30

qtTeOptions.AutoAdvance = False ' Specifies that the emulator does not support auto-advance fields
qtTeOptions.AutoSyncKeys = "13" ' Record a Sync step each time the Enter key is pressed while recording the test
qtTeOptions.RecordMenusAndPopups = True 'Enable recording of emulator popups and menus
qtTeOptions.RecordCursorPosition = True 'Record cursor position steps
qtTeOptions.UsePropertyPattern = True ' Use default property pattern file
qtTeOptions.PropertyPatternsFile = "C:\Program Files\HPE Software\Unified Functional Testing\Dat\PropertyPatternConfigTE.xml"

' Specify the current emulator
qtTeOptions.CurrentEmulator = "IBM Pcom" ' Set the current emulator as Host On-Demand 8.0

' Set options that are specific to the current emulator
qtTeOptions.Protocol = "autodetect" 'Let UFT detect the session protocol
qtTeOptions.BlankLines = 0 ' No blank lines at the bottom of the emulator window.
qtTeOptions.CodePage = 0 ' Use the default code page conversion
qtTeOptions.HllapiDllName = "C:\Program Files\IBM\EHLLAPI\pcshll32.dll" ' Specify the HLLAPI dll to use
qtTeOptions.HllapiProcName = "hllapi" ' Specify the HLLAPI function to use
qtTeOptions.VerifyHllapiDllPath = True ' Display a warning message if the HLLAPI dll is not found
qtTeOptions.ScreenLabelUseAllChars = True ' Use protected and unprotected fields to identify the screen label.
qtTeOptions.WindowTitlePrefix = "MyTerminal" ' Identify the terminal window based on its window title prefix.
qtTeOptions.TrailingMode = True ' Trim white characters when recording in context-sensitive mode
qtTeOptions.TrailingFieldLength = 5 ' if the field begins with more than five black characters.
qtTeOptions.BeepOnSync = False ' Do not beep after each Sync step.
qtTeOptions.UseKeyEvent "@R", "17;52" ' Replay the TE_RESET key using the CTRL+R keyboard event.
qtTeOptions.SyncTime = 200 ' Wait 200 milliseconds before checking the emulator status

' Clean up
Set qtTeOptions = Nothing ' Release the TE Options object ' Release the Te Options object
Set qtApp = Nothing ' Release the Application object ' Release the Application object



End Function

End Sub

now is my question do I make the program visible also called from another function in another sub?

Thank you in advance
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top