IBM Personal Communications emulator methods
Summarize
Summary of IBM Personal Communications Emulator Methods
The IBM Personal Communications emulator methods enable users to automate various tasks within the emulator environment. These methods allow for screen-level and element-level operations, facilitating tasks such as text retrieval, input simulation, and screen verification.
Show less
Key Features
- Screen-Level Methods:
- GetFieldText: Retrieves text from a specified field based on row and column numbers.
- GetTextFromRect: Captures text from all fields within a defined rectangular area on the screen.
- IsCreated: Checks if the emulator screen exists and is ready for input.
- SearchText: Finds the location of a specified text within a field.
- SendKeys: Simulates keyboard input at the mouse position on the emulator screen.
- SendKeysSecure: Similar to SendKeys, but for secured strings.
- SetCursorPosition: Moves the mouse cursor to a specified row and column on the screen.
- WaitForCreate: Pauses execution to allow the emulator to confirm screen or element existence.
- Element-Level Methods:
- GetAsTable: Retrieves captured text as a data table object.
- GetText: Gets text from a field or the first field of a captured table.
- IsCreated: Verifies if a captured element exists based on matching rules.
- SetText: Attempts to input text into a specified field.
- WaitForCreate: Similar to the screen-level version, it checks for element existence.
Key Outcomes
By utilizing these methods, ServiceNow customers can effectively automate interactions with the IBM Personal Communications emulator, enhancing efficiency and accuracy in data handling and user operations. These methods offer the capability to programmatically control the emulator, allowing for streamlined workflows and improved task execution.
Use the IBM Personal Communications emulator methods to perform various automation tasks on the IBM Personal Communications emulator.
Screen-level methods
Use screen-level methods to perform the automation tasks on the emulator screen. For example, you can simulate a command on the screen or get text from the screen.
GetFieldText
Returns the text that a field contains after it identifies the field by the row and column number that you specify. The row and column that you specify are the starting point of the field. The method identifies the whole
field and then returns the text in the field. In the following example, H is the first letter and the starting point in the field and Host OS : is the complete text in the field.
| Parameter | Description | Data port entry type | Data type | Default value | Mandatory | Notes |
|---|---|---|---|---|---|---|
| Row | Field row number that identifies the field. | Data In | Integer | NA | Yes | |
| Column | Field column number that identifies the field. | Data In | Integer | NA | Yes | |
| Return | Returns the text in the field. | Data Out | String | NA | NA |
GetTextFromRect
Returns the text in all the fields of a rectangular area that you define on the screen. You define an area by providing the starting and ending rows and column numbers. The method locates and identifies the first and the last fields and returns all the text in all the fields within that area. The following example shows the area that you defined.
| Parameter | Description | Data port entry type | Data type | Default value | Mandatory | Notes |
|---|---|---|---|---|---|---|
| StartRow | Row number that indicates the first character of the first field in the rectangular area. | Data In | Integer | NA | Yes | |
| StartCol | Column number that contains the first character of the first field in the rectangular area. | Data In | Integer | NA | Yes | |
| EndRow | Row number that contains the last character of the last field in the rectangular area. | Data In | Integer | NA | Yes | |
| EndCol | Column number that contains the last character of the last field in the rectangular area. | Data In | Integer | NA | Yes | |
| Return | Returns the text from all the fields within the rectangular area. | Data Out | String | NA | NA |
IsCreated
Verifies whether the emulator screen exists based on the screen match rule and can accept inputs from the user. After verification, the method returns the appropriate Boolean value.
| Parameter | Description | Data port entry type | Data type | Default value | Mandatory | Notes |
|---|---|---|---|---|---|---|
| MatchAllChildren | Option to find the emulator screen by matching the child elements that you have captured. | Data In | Boolean | False | Yes |
Warning:
Using this option may slow down the method. |
| Return | Returns the Boolean value depending on whether emulator screen exists based on the screen match rule and can accept inputs from the user. | Data Out | Boolean | NA | NA |
SearchText
emulator, the method returns the row and column numbers of the
starting point of the word emulator which is e.| Parameter | Description | Data port entry type | Data type | Default value | Mandatory | Notes |
|---|---|---|---|---|---|---|
| Text | Text that the method searches. | Data In | String | NA | Yes | The text you specify may be case-sensitive depending on the emulator you use. |
| Row | Row number that has the first character of the text you specify. | Data Out | Integer | NA | NA | If the text that you specify occurs at multiple rows and columns, the method returns the first row and column that contains the text. |
| Col | Column number that has the first character of the text that you specify. | Data Out | Integer | NA | NA | If the text that you specify occurs at multiple rows and columns, the method returns the first row and column that contains the text. |
SendKeys
Simulates the keystrokes that you enter from the keyboard at the mouse device position on the emulator screen. For example, you can simulate the [enter] keystroke on the screen.
| Parameter | Description | Data port entry type | Data type | Default value | Mandatory | Notes |
|---|---|---|---|---|---|---|
| Keys | Keystrokes that you enter from your keyboard. | Data In | String | None | Yes |
Tip:
To learn about the keystrokes, refer the respective terminal emulator documentation. |
SendKeysSecure
Simulates the keystrokes that is a secured string at the mouse device position on the emulator screen.
| Parameter | Description | Data port entry type | Data type | Default value | Mandatory | Notes |
|---|---|---|---|---|---|---|
| Keys | Keystrokes that you enter as a secured string. | Data In | Secured String | None | Yes |
Tip:
To learn about the keystrokes, refer to the respective terminal emulator documentation. |
SetCursorPosition
Attempts to set the mouse device at the row and column number that you specify.
| Parameter | Description | Data port entry type | Data type | Default value | Mandatory | Notes |
|---|---|---|---|---|---|---|
| Row | Option to provide the number of the row based on which the method attempts to set the mouse device on the screen. | Data In | Integer | NA | NA | The row number must be positive and within the size of the emulator screen. For example, if the screen size is 24X80, the maximum value that you can provide for a row is 24. |
| Col | Option to provide the number of the row based on which the method attempts to set the mouse device on the screen. | Data In | Integer | NA | NA | The column number must be positive and within the size of the emulator screen. For example, if the screen size is 24X80, the maximum value that you can provide for a column is 80. |
WaitForCreate
Waits for the duration that you specify while the connector uses the screen match rule to find whether the screen exists.
| Parameter | Description | Data port entry type | Data type | Default value | Mandatory | Notes |
|---|---|---|---|---|---|---|
| timeoutinSeconds | Option to provide the number of seconds for which the method waits while the connector uses the screen match rule to find if the screen exists. | Data In | Integer | 30 | Yes | |
| MatchAllChildren | Option to match all screen elements that you had captured to find if the screen exists. | Data In | Boolean | False | Yes |
Warning:
Using this option may delay the execution of the method. |
| Return | Returns the Boolean value based on whether the emulator screen was found. | Data Out | Boolean | NA | NA |
Element-level methods
Element-level methods perform automation tasks on the emulator screen elements that you add from the Terminal Connector screen. You can add a screen element as a field or a table.
GetAsTable
Returns the text that you captured as a data table object. Use this method when you capture the data from a screen as a table. However, you can also use the method for the data that you capture as a field. To learn how to capture the data as a table, see Configure the IBM Personal Communications emulator.
| Parameter | Description | Data port entry type | Data type | Default value | Mandatory | Notes |
|---|---|---|---|---|---|---|
| Return | Returns the captured text from the terminal screen as a data table object. | Data Out | Data Table | NA | NA | To view the table, right-click the parameter and select Preview Data. |
GetText
Returns the text in the field that you captured from the emulator screen. If you use this method for a table that you captured, it returns the text in the first field of the rectangle.
| Parameter | Description | Data port entry type | Data type | Default value | Mandatory? | Notes |
|---|---|---|---|---|---|---|
| Return | Returns the text from the captured field. | Data Out | String | NA | NA |
IsCreated
Matches the rules and verifies whether the captured element exists.
| Parameter | Description | Data port entry type | Data type | Default value | Mandatory | Notes |
|---|---|---|---|---|---|---|
| Return | Returns the Boolean value based on whether the element is active. | Data Out | Boolean | NA | NA |
SetText
Attempts to set the text to the field.
| Parameter | Description | Data port entry type | Data type | Default value | Mandatory | Notes |
|---|---|---|---|---|---|---|
| Text | Option to specify the text that the method attempts to set in the field. | Data In | String | NA | Yes | You can't use this method on protected emulator screens. |
WaitForCreate
Waits for the duration that you specify while the connector uses the match rule to find whether the element exists.
| Parameter | Description | Data port entry type | Data type | Default value | Mandatory | Notes |
|---|---|---|---|---|---|---|
| timeoutinSeconds | Option to provide the number of seconds for which the method waits while the connector uses the match rule to find whether the element exists. | Data In | Integer | 30 | Yes | |
| Return | Returns the Boolean value depending on whether the element was found. | Data Out | Boolean | NA | NA |