Copying Text in a Terminal
When testing a terminal emulator, there are times when values are on the terminal emulator screen that need to be used within the test. These values can be pulled from the database using SQL/MOCA Calls as learned in other sections of this manual; however it is much simpler to copy values off the screen and store them as variables. Using the Step below, users can specify what row and column range to copy into a variable. For non-technical users, this allows the ability to write tests that can use data on the screen without having to write a SQL statement or MOCA Command to determine the value, as it is presented on the screen. For example, when performing inventory transfer the next allocated location for the lodnum picked up will be shown on the screen as a suggested putaway location; however in an automated test it is difficult to copy that value off the screen and use it. This Step will store the value copied off the screen into a variable to be used within the Scenario.
To copy a value off the terminal emulator screen and store into a variable use the following Step:
I copy terminal line <LINE_NUMBER> columns <COLUMN_START> through <COLUMN_END> to variable "< VARIABLE_NAME >"
I copy terminal line 1 columns 2 through 8 to variable "wh_id"
The terminal Steps are 1-indexed as opposed to 0-indexed, which means you should start at "1" when counting lines and columns to determine cursor location in the terminal. Counting should begin in the upper left-hand corner of the terminal.
- If the characters on the terminal emulator screen are too long for the current screen size, some characters may be overwritten at the end of the last word in the line. For example, on an 8-character-wide screen, "Developer" would appear as "Developr". On a 7-character-wide screen, it would appear as "Develer". This may cause "I see" (validation) Steps to fail unexpectedly, or "I copy" Steps to copy unexpected text.
- We recommend JDA users use the "Generic" JDA size terminal to avoid the above problem on JDA screens that are known to have this issue.