Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
tutorial:scripting_comb_data_model [2020/07/18 02:42] – [Model scripting] admin | tutorial:scripting_comb_data_model [2024/01/03 19:54] (current) – removed admin | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Tutorial: Automation Scripting - Combinatorial Model ====== | ||
- | |||
- | Learning Objectives: | ||
- | * Model scripting | ||
- | * Looping through DataTable | ||
- | * Activating plugins | ||
- | * Persisting and exporting results | ||
- | |||
- | This tutorial assumes that you are familiar with how to create a Combinatorial Data Model and have created a simple model with at least 2 variables named Field1 and Field2 and have generated the DataTable. | ||
- | |||
- | |||
- | ===== Model scripting ===== | ||
- | [[https:// | ||
- | |||
- | //Groovy// script is syntactically very similar to most of programming language that allows you to create classes, functions and basic logic and arithmetic operations. | ||
- | |||
- | Unlike [[scripting_state_model | scripting for State Model]], you just write your script right in [[../ | ||
- | |||
- | | ||
- | |||
- | Run the model, you should see following returned and displayed on IDE: | ||
- | |||
- | Total number of rows in DataTable: 10 | ||
- | |||
- | |||
- | ===== Activating Plugins ===== | ||
- | Just like [[scripting_state_model | scripting for State Model]], you need to activate plugins to interact with AUT to perform the testing on each row in the DataTable. | ||
- | |||
- | For this tutorial, activate //Random// plugin, and modify the script to use // | ||
- | |||
- | for (Map< | ||
- | if ($RANDOM.randNum(0, | ||
- | | ||
- | | ||
- | } | ||
- | else { | ||
- | | ||
- | | ||
- | } | ||
- | $DATASET.notifyClient(row); | ||
- | } | ||
- | |||
- | |||
- | |||