Grids are used within many PeopleSoft pages to handle multiple rows of data. The page manages this by indexing the field names. For example, the General Ledger Journal page uses a grid for the journal line data:
The field names are indexed using a zero based index. Row 1 is a 0 index, Row 2 is an index of 1, Row 3 an index of 2, and so on.
When recording the fields of each row in the grid, the index is captured as part of the complete field name. The index is represented as a $ sign and row number.
If the test scenario utilizes an associated datasheet for the data within a grid, then the script must include the logic to manage the index values.
One approach is to include a column in the datasheet to identify the grid row index.
Then edit the field name in the script to concatenate the field name and index value from the datasheet column:
Original recorded field name:
Edited, concatenated field:
Note: The field name, including the $ sign is within quotes and parenthesis as the fixed portion of the field name. The concatenation is the + sign and the datasheet column name of the row index value.
Another approach is to use a variable to manage the grid index. The variable is set at zero and increased by 1 as page processing progresses through the rows in the grid.
Grid index / line counter requirements:
- Define a variable to be used as the line counter
var linecounter = 0;
- Increase the “linecounter” each time a new row in the grid is added
linecounter = linecounter + 1;
- If appropriate depending on the page processing and test scenario requirements, reset the counter back to zero:
linecounter = 0;
- The field follows the same concatenation logic as option 1, just using the line counter variable instead of a datasheet field.
Notes: The placement of this logic is coordinated with the data sheet and the page processing details.
For example, for each new journal header the linecounter is set (or reset) to zero. For each new journal row within that header, the line counter is increased by 1.
Similar logic and field handling may be required to manage the PeopleSoft action actually triggers a new row in the grid.