Java Framework – Test Modeller Code Generation
Search Knowledge Base by Keyword
So far, we have covered creating and tagging the automation code with the associated test data allocations manually. Test Modeller can be used to automatically create this code with the appropriate method calls embedded to execute associated data allocations and consume the resolved results within each associated automation parameter. To do this you must first create a model with both automation and test data allocations overlaid.
Once you have a model with the test data and automation you can click the execute button within the test cases side-bar below. Click here to learn more about test case generation.
Once execute has been clicked, the export dialog should be displayed. Here you can specify the server, process, code template, and allocation pool to use. The code template ‘Java Allocation’ contains the appropriate code snippets to construct java allocation code for TestNG (as defined manually above). If the actions below do not appear in your automation server you may need to add data allocation to your server. If your framework is not using our out-the-box TestNG code, you can edit and create custom code templates.
Click the execute button to run the code generator. A first pass is made to perform an initial allocation and create the associated tests within the data catalogue allocation pool selected. After this the associated code is created referencing the created tests within the associated allocation pools selected.
Once the generation is complete a screen will appear with a status of complete and the ability to download a Result.zip file.
Before downloading the created ‘results.zip’ file it is useful to look at the allocation pool you have selected. Here you should see the allocation pool has been populated with the associated test types, along with the initial allocated values.
Within the code folder there is a java file which contains the code definition. Open this file within a text editor to inspect the corresponding java test definition with data allocations generated.
Below is a screen capture of example code file generated. Pay particular attention to the embedded @DataAllocation tag referencing the data pool, test suite, and test cases, along with the appropriate DataAllocationResult objects embedded in the appropriate automation actions by getting the values by column indexes.
-
-
-
- IEnumerable to Data Reader
- Data Table to List
- Nested String List to Data Table
- List to Data Table
- IEnumerable to List
- List to IEnumerable
- Remove from List
- Exists in List
- Value Exists in Dictionary
- Key Exists in Dictionary
- Remove from Dictionary
- Get from Dictionary
- Clear Dictionary
- Add to Dictionary
- Clear List
- Add to List
- Show all articles ( 1 ) Collapse Articles
-
-
-
-
- Explanation of Remaining Sheets in the Control Spreadsheet (for reference only)
- The ForeignKeys Sheet - Specifying which Foreign Keys to read from the Source Database
- The Tables Sheet: Defining Metadata that will be read from the Source Database
- The ProcessModel sheet – Toggling Subset Rules
- Refining the Control Spreadsheet
- Overview of the Advanced Control Spreadsheet
- Introduction
-
- Drop both Primary and Foreign Keys (The composite DROPKEYS Action)
- Validate Both Primary and Foreign Keys (The composite ValidateKeys Action)
- Add Both Primary and Foreign Keys (The Composite ADDKEYS action)
- Drop Tables
- Truncate Data
- Delete Orphans
- Drop Primary Keys
- Drop Foreign Keys
- Validate that Foreign Keys are Unique
- Validate that Primary Keys are Unique
- Add Foreign Keys
- Add Primary Keys
- Overview of Post-Subset Actions
-
-
- Use Event Hooks to call VIP Flows
- Different Methods for Connecting to Source Databases
- PreProcess Variables and Parameters
- Using SQL Functions to query Databases and Using the Queries in Data Generation Functions
- Summary of the Process to Configure the Test Data Configuration sheet
- How the PreProcessVariables Table is used in the Configuration sheet
- Sample Commerce Configuration Sheet Examples
- Adding Event Hooks in Configuration sheet for custom functionality
- How to Configure the Synthetic Test Data Configuration Control Sheet
-
-
-
-
-
- The UI Recorder
- Test Modeller – Maintenance
- Test Modeller Core (Linux) Optional – Postgres LDAP
- Test Modeller Core (Linux) Optional – SSL Certificate Installation
- Test Modeller Core (Linux) Optional – Active Directory
- Test Modeller Core (Linux) Installation
- Test Modeller: Software Pre-requisites
- Test Modeller : Installation components
- Test Modeller : System requirements (Windows, Linux)
-
-
-
-
-
-
- Common Problems
- Extend Test Modeller (Advanced)
- Edit Code Templates (Advanced)
- Import existing framework / custom page objects (Advanced)
- Execute Tests (Java)
- Generate Automation Code
- Build a Model (Java)
- Scan an Existing Web App
- Configuration (Java)
- Prerequisites (Selenium Java)
- Welcome Selenium (Java)
-
-
-
-
- Generate Optimised Test Cases and Data into Excel
- Implement Naming Conventions
- Page Object Generation
- Intelligent Page Objects
- Customising Page Objects
- Import Custom Code Snippets
- Rule-Based Test Generation
- Trigger Automation Execution from within Test Modeller
- Automation Configuration
- Test Data Automation for Gherkin Specifications
-
-