Create HOST Modules
Tosca can detect and interact with Labels, TextBoxes, and Tables in HOST applications. To make this possible, you need to first scan your HOST application. This chapter describes how to scan HOST applications to create Modules.
Prepare for HOST scan
This section explains extra steps you need to take before you scan HOST controls with XScan.
Choose your session mode
HOST Engine 3.0 supports the following session modes:
-
HOST emulator sessions. An emulator session uses an active HOST emulator connection to navigate your mainframe application via your emulator. Emulator sessions support ASCII, as well as and Japanese character sets if you enable Japanese character support in your project settings. It is possible that the Scan may display characters that aren't visible in the emulator.
-
HOST headless sessions. A headless session uses an active HOST headless connection to navigate your mainframe application via the Host Scan window. Headless sessions only support the ASCII character set.
Choose your use case:
To start an emulator session, follow these steps:
-
Make sure your emulator is connected to a session.
-
In the scan window's ribbon menu, select Connection Settings.
-
From the Connection name dropdown list, select Connect to Emulator Session.
-
Select Connect.
To start a headless session, follow these steps:
-
In the scan window's ribbon menu, select Connection Settings.
-
Fill out the settings, then select Connect.
The Timeout settings defines the maximum time allowed (in milliseconds) for any communication between Tosca and the HOST server.
Enable Japanese character support
To use the Japanese character support for HOST emulator sessions, follow these steps:
-
Go to Project->Settings.
-
Create a new category named Host in the Settings->TBox->Engines.
-
Create a new setting with the name CodePage and the value 932.
Start the scan
To create HOST Modules, scan an active and connected HOST session with Tosca XScan.
To do so, right-click a Module folder and select Scan->Remote Terminal. Alternatively, you can go to the dynamic menu Modules and select
Scan->Remote Terminal or use the keyboard shortcut Ctrl + Shift + T.
Choose your controls
Tosca measures all heights and widths of HOST controls in characters.
When you select a control area in the Host Scan window, avoid separating double-width characters. A double-width character occupies two character units instead of the standard one. To ensure a correct scan of Host controls, it is important to pay attention to this. To do so, follow these steps:
-
In the ribbon menu of XScan, select the type of control you want to add to your Module:
Label,
TextBox, or
Table. -
Create your control.
Choose your use case:
I want to create a Label controlFor Label control, highlight the line where your test is located in the Content Preview.
Tosca automatically uses the following properties to define your control:
Properties
Description
Height
Overall height of the table.
Width
Overall width of the label.
Column
On-screen position of the starting column of the label.
Row
On-screen position of the starting row of the label.
I want to create a TextBox controlFor a HOST TextBox control, highlight the content in the Content Preview, or use the ribbon entry Search TextBoxes. Make sure to check that the Content Preview matches the screen you want to scan. You can update the preview to the current emulator screen by selecting Refresh.
For headless HOST sessions, you can use the ribbon menu entry Input Password for sensitive data. This lets you input this data in a separate field, which is then safely sent to the mainframe without showing your input on screen.
Tosca automatically uses the following properties to define your control:
Properties
Description
Height
Overall height of the table.
Width
Overall width of the label.
Column
On-screen position of the starting column of the label.
Row
On-screen position of the starting row of the label.
I want to scan a TableFor a HOST Table control, select Area in the ribbon menu of the scan. Then, highlight the outer area of your Table in the Content Preview. Alternatively, you can define the area of manually in the Properties pane.
When you highlight your table area in the Content Preview, make sure that you define your column border correctly. These columns define the input fields of your modules, which means that text that belongs to the column must fit into the defined column area. If you miss the starting point of the input field, the input step in your test case won't work.
Tosca automatically uses the following properties to define your control:
Property
Description
Height
Overall height of the table.
Width
Overall width of the table.
Column
On-screen position of the starting column of the table.
Row
On-screen position of the starting row of the table.
ColStartList
Comma-separated list of the first character of every column, relative to the control coordinates. This property always starts with 1.
HeaderHeight
Height of the header, counted from the top of the table. The default value is 0.
RowHeight
Specifies the row height. The default value is 1, which means that Tosca counts every line as a row.
HeaderRow
Specifies whether the table has a header or not:
-
-1: table has no header.
-
1: table has a header.
NoScroll
Specifies whether the table spans over multiple screens or not. The default value is False.
ScrollForwardKey
Specifies the key to scroll the table forward. The default value is {F8}.
ScrollBackwardsKey
Specifies the key to scroll the table backwards. The default value is {F7}.
-
-
To add additional controls to your Module, repeat this process.
-
If you're scanning HOST and you want to add controls from another screen, we recommend that you select Finish screen before you navigate to the new screen. Tosca saves each Module with a screenshot according to the Content Preview when you select Finish screen. We recommend that you use Refresh to update the Content Preview when you create separate modules for separate screens. This keeps Module screenshots consistent with the controls in HOST and avoids confusion later on.
-
Once you've selected all controls you want to add to the Module, select Finish screen. This saves the Module to your workspace. Then, select Close.
You can now steer HOST controls, create a TestCase with HOST modules from the Standard Subset.