Test Modeller
If you work with model-based test automation for open source automation frameworks and have tests created with Test Modeller by Curiosity Software, you can integrate and run those tests with Perfecto.
A sample project, used throughout this tutorial, is available in GitHub: https://github.com/CuriositySoftwareIreland/TestModeller_Perfecto
You can also use an existing automation framework with Test Modeller, as discussed in Step-by-step instructions, 1 | Import code templates.
For information on getting started with a Perfecto sample project on GitHub, including parallel execution and integration with Perfecto Smart Reporting, see the Perfecto sample project section.
On this page:
Introduction
Test Modeller is a browser-based solution that enables you to:
- Model a system under test as BPMN-style flowcharts.
- Automatically generate test cases from the model, optimizing testing for time and risk.
- Define test data at the model level and generate data at the same time as test cases.
- Export test automation scenarios, automatically generating coverage-focused automation scripts.
- Export test cases to test case management lifecycle tools at ease (such as Jira, ALM, Octane, and so on).
- Analyze test results and manage existing artifacts with visual dashboards and a file management system that introduces traceability between test assets.
Review this section to get started with creating automation for execution in Perfecto. The goal of this integration is to provide model-based test automation for execution with devices hosted within Perfecto.
Watch this short video for a full demo showing the resulting features.
Prerequisites
Make sure you have the following available:
- An automation framework using Perfecto. You can use our sample framework if you do not already have an automation framework for consumption.
- An active Test Modeller license. You can sign up for a free trial at https://testmodeller.io.
Step-by-step instructions
Learn how to create a new project using the sample automation framework provided by Curiosity Software for Test Modeller with Perfecto. By the end of these instructions, you will have Perfecto linked to Test Modeller such that you can seamlessly generate coverage-focused test automation at ease for execution in Perfectousing model-based testing.
All code created using Test Modeller uses code templates that define the structure and type of code to be created. Test Modeller provides support for numerous open-source frameworks out-the-box, made available on the Curiosity Software GitHub page (https://github.com/CuriositySoftwareIreland).
The sample framework provides pre-configured code templates within the Code Template directory. To import these into Test Modeller, follow these steps. A video tutorial is also available:
To import code templates:
-
Log in to Test Modeller.
-
On the Workspace > Configuration tab, select code templates from the configuration view.
-
Upload both the page object and test case code templates by clicking Import to the right of the Code Template header.
-
Register a new automaton framework using the code templates. You need to select the code template and test case templates that you previously uploaded.
-
Create a new project within Test Modeller that will be used as a workspace for the page objects and models created for consumption by Perfecto, as follows:
Go to Project & Releases’. Select to create a new project and enter a suitable name for the project.
In the wizard select the automation framework you just created to bind to create the project. This tells Test Modeller to use this specific framework for generations (although it can be overridden at any time).
Important: This is using the sample framework and configuration provided by Curiosity Software. You may have your own Perfecto based automation framework. This can be integrated into Test Modeller by configuring your own code templates. The following video tutorial is also available.
Within the sample framework, you need to specify your Perfecto API endpoint and the access token to connect to your Perfecto instance. In the sample framework, this is configured in the following class:
Framework\src\main\java\utilities\CapabilityLoader.java
You can specify the API key and token here, along with the device capabilities of the device within the Perfecto instance against which you wish to execute the tests.
Follow section 3 at https://testmodeller.io/tutorials/selenium-java or watch the following video.
Follow section 4 at https://testmodeller.io/tutorials/selenium-java or watch the following video.
Follow section 5 at https://testmodeller.io/tutorials/selenium-java or watch the following video.
Follow section 6 at https://testmodeller.io/tutorials/selenium-java or watch the following video.
Advanced
Test Modeller can directly integrate with your automation framework when it is stored in a Git-based source control repository. This entails automatically committing page objects and automated test scenarios when an object is generated in Test Modeller. You can also configure Test Modeller to execute tests on a publish to gather instant feedback on a test execution.
Perform the steps described in this video tutorial:
Perform the steps described in this video tutorial:
Perfecto sample project
This procedure helps you get started with a Perfecto sample project so you can work with an open-source repository of Java-based Selenium tests in Test ModellerandPerfecto. The sample project is available on GitHub: https://github.com/PerfectoMobileSA/Perfecto-TestModeller-Sample
You can follow along watching this tutorial.
Begin with installing the dependencies and continue with the Getting Started procedure that follows.
Make sure to install the following required dependencies on your machine before starting to work with this project:
-
An IDE to write your tests in, such as Eclipse or IDEA IntelliJ
Depending on your IDE, you also need to install:
The TestNG plugin is built into IntelliJ IDEA version 7 and later.
The following installations are optional:
- For source control management, you can install git.
- To be able to interact with a real device in the Perfecto cloud directly from your IDE, and to use Perfecto Smart Reporting, install the Perfecto CQ Lab Plugin for your IDE.
-
Clone the repository.
-
Download the project and unzip it to your computer.
-
In your IDE, open the project by choosing the folder that contains the
pom.xml
file.
Perform the following procedure to run the sample as is. Refer to official documentation on how to execute from your respective IDE (Eclipse or IntelliJ).
To run the sample as is:
-
Register the code templates to Test Modeller by following this tutorial.
-
Copy the generated
page objects
into theFramework\src\main\java\pages
directory. -
Copy the generated
tests
into theFramework\src\test\java\tests
directory. -
Open
CapabilityLoader.java
from thesrc/main/java/utilities
package. -
Update the cloud information as follows:
- Add your security token:
Search for the following line:
CopyString securityToken = "<<security token>>";
Replace
<<security token>>
with your Perfecto security token or pass it as Maven properties, as follows:Copy-DsecurityToken=<<security token>>
- Run the
pom.xml
file with the following Maven goals and properties. Maven will automatically kick-start the parallel execution of different examples inside the Perfecto package. -
To perform the CI dashboard integration, supplying the following properties to the top-level Maven targets:
Copyclean
test
-DcloudName=${cloudName}
-DtestngXmlFile=testng.xml
-DsecurityToken=${securityToken}
-Dreportium-job-name=${JOB_NAME}
-Dreportium-job-number=${BUILD_NUMBER}
-Dreportium-job-branch=${GIT_BRANCH}
-Dreportium-tags=${myTag}
Smart Reporting integration example
The following images show a sample report in the CI Dashboard view and the Report Library.