Back to QMetry All Products Help Page
QMetry Test Management Plug-in Documentation
QMetry Test Management plugin for Jenkins is designed to seamlessly integrate your CI/CD pipeline with QMetry Test Management.
Download Link: QMetry Test Management for Jenkins
About the Plugin
QMetry Test Management plugin for Jenkins has been designed to seamlessly integrate your CI/CD pipeline with QMetry.
Easily configure Jenkins to submit your test results to QMetry without needing to write any code or deal with REST API. Your Test Results could be from any automation framework like Cucumber, Test NG, JUnit, QAF and more.
For more info visit QMetry Test Management.
Read the following topics on this page:
Pre-requisites
How to install QMetry Test Management Plugin for Jenkins
Configuring a standard Jenkins Job.
Configuring QMetry Plugin job as a post build action.
Triggering the job and publishing results in QMetry.
Pre-requisites
QMetry Test Management installed on Server or Cloud
Jenkins installation
How to install QMetry Test Management Plugin for Jenkins
Login to Jenkins and go to Manage Jenkins.
2. Locate the Manage Plugins section.
3. Open the Available tab and search for "QMetry Test Management".
4. Locate and select the QMetry Test Management Plugin. Choose install option either Install without Restart OR Download Now and install after restart.
Configuring a Standard Jenkins job
You can configure Jenkins job through either of the following options:
Freestyle Project
Pipeline
Freestyle project
Let’s create a standard Freestyle job in Jenkins.
To create a new Jenkins job, click on the New Item option on the Jenkins menu.
2. Provide a name for your job.
Select Freestyle project on the screen and then click OK.
3. Next, the configuration page appears where you can configure your job by various categories: General, Source Code Management (SCM), Build Triggers, Build, and Post build actions.
4. On the Source Code Management tab, select the appropriate option in which you have your source code. For example, here it is “Git”. So, select “Git” and provide the necessary information. (Note: You need to configure GitHub plugin in global configuration).
5. Optionally, you can set Build Triggers.
Select the Build Triggers tab. Let’s just add a periodic trigger which triggers build every minute – every hour – every day (Schedule: * * * * *).
6. Next, Select a build step. You can select from various options: Ant, Maven, Windows batch process, etc. For example, for a maven project, trigger a maven build and specify goals.
Next step is to add Post-build Actions. Here, add the plugin: “QMetry Test Management Plugin”.
Configuring QMetry Test Management Plugin as a Post-build Action
Jenkins works as a bridge between QMetry Test Management and automation frameworks. To publish results in QMetry, define another post-build action.
1. On the Add post-build Actions drop-down, select the "Publish test result to QMetry" option.
2. Fill in the required data. You can get more information regarding fields by clicking on the Help icon for respective fields. It explains what to enter in that particular field.
Parameters
Parameter | Type | Required | Description | ||||||
QMetry URL | string | Yes | QMetry Test Management URL | ||||||
Automation API Key | string | Yes | Your API Key. API Key is unique for a specific user in a single project. The result will be imported for the project associated with the given API Key. | ||||||
Proxy URL | string | No | Enter Proxy URL if you have configured any Proxy. | ||||||
Automation Framework
| string | Yes | Format of result file to be imported. Supported formats:
| ||||||
Automation Hierarchy | string | No | Hierarchy which will be used to parse test result files on QTM. Supported formats are :- JUnit 1 - Use current Hierarchy in which JUnit Testcase is treated as TestStep and Testsuite is treated as Testcase (default) JUnit File Type 1: Wherein testsuite "name" matches the test case "classname".
JUnit File Type 2: Wherein testsuite "name" does not match the test case "classname".
2 - Use Junit Testcase as Testcase and link all those (from all testsuites and all files of Junit) to one Testsuite 3 - Create Multiple Testsuites and then link their respective testcases in corresponding Testsuites TestNG 1 - Use class 'name' as Testcase and test-method as TestStep (default) 2 - Use test-method as Testcase 3 - Use test 'name' as Testcase and test-method as TestStep | ||||||
Result File(s) Path/Directory | string | Yes | Path wherein your result file to be uploaded. Supported file extensions: .json, .xml and .zip (zip file must contain files of the format given in the 'Automation Framework' param). If your automation generates multiple result files of the supported format in a folder then provide the absolute path till the folder name(It should not be the path till workspace). QMetry plugin will zip all supported format files and upload them to QMetry. | ||||||
Test Suite ID | string | No | Key of the test suite exists in QMetry. In the absence of Key, a new test suite will be created. Note: If for Junit - 3 - Create Multiple Testsuites and then link their respective testcases in corresponding Testsuites - is chosen, then the parameter Test Suite ID will be ignored. | ||||||
Test Suite Name | string | No | If existing "testsuiteId" is not being used and auto-generated name for the new test suite is not desired, then a custom test suite name can be entered for this parameter. Note: If for Junit - 3 - Create Multiple Testsuites and then link their respective testcases in corresponding Testsuites - is chosen, then this parameter will be ignored. | ||||||
Test Suite Folder Path | string | No | New test suites will be created in a specified test suite folder while importing automated test results. If the folder does not exist, it gets created. This parameter will be ignored if the test suite is being reused. This parameter is not supported for server edition of QTM now and if specified, it will be ignored. | ||||||
Project | string | Yes | ID/Key/Name of the Project within which the test suite will be created. | ||||||
Release | string | *No | ID/Name of the Release in which the test execution will be created. If Release is not mentioned, then Default Release will be considered. | ||||||
Cycle | string | No | ID/Name of the Cycle in which the test execution will be created. If Cycle is not mentioned, then Default Cycle will be considered. | ||||||
Build | string | No | Build Name/Id. In the absence of a value, it will create the default build. | ||||||
Platform | string | No | Name of Platform on which test run to be executed. | ||||||
Test Case Fields | JSON | No | Mention system defined fields and user defined fields for test case as shown in Test Case JSON format below. All the mandatory fields other than Summary should be mentioned in this parameter. | ||||||
Test Suite Fields | JSON | No | Mention system defined fields and user defined fields for test case as shown in Test Suite JSON format below. All the mandatory fields other than Summary should be mentioned in this parameter. This parameter will be ignored if existing Test suite Id is used to upload results. | ||||||
Skip Warning | string | No | Skip Warning while uploading test result file(s) to QMetry. Supported values are: 0 - Test Case Import will be failed if the Test Case summary is more than 255 characters. (default) 1 - Test Cases can be imported by ignoring the warning about summary length. If the test case summary is longer, it will be truncated to 255 characters. | ||||||
Is Matching Required | string | No | Create a new test case version or reuse the already created version while uploading test result file(s) to QMetry. 1 - Create a new test case or test case version if the test summary and steps of any of the test case versions do not match with the test case in the result file. (default) 0 - Reuse already linked test case version in test suite or auto link the existing latest version of test case to test suite, if the test case entity key OR test case summary matches with the test case in the result file. The execution status of the linked test cases will be updated.
This parameter is not supported for server edition of QTM now and if specified, it will be ignored. |
* Release is mandatory if Cycle is mentioned.
Robot Framework
Robot Framework result files can be of multiple hierarchy structures. The structure of these files depends upon the libraries that are used to generate the automation results.
Robot File Tag - Structure & Hierarchy | Tag that is created as QMetry Test Suite | Tag that is created as QMetry Test Case | Tag that is created as QMetry Test Case Step |
|---|---|---|---|
suite>test case>steps | <suite> tag will be created as Test Suite. | <test> tag under the <suite> tag will be considered as Test Case.
| <kw> tag under the<test> tag will be considered as Test Case Step. |
suite>(sub/inner) suite>test case>steps | <(sub/inner) suite> tag under the <suite> tag will be considered as single Test Suite. Multiple test suites will be created each (sub/inner) suites. | <test> tag under the <(sub/inner) suite> tag will be considered as Test Case.
| <kw> tag under the <test> tag will be considered as Test Case Step.
|
suite>test case>steps>sub steps | <suite> tag will be considered as Test Suite | <test> tag under the <suite> tag will be considered as Test Case. | <kw> tag under the <test> tag will be considered as Test Case Step. <kw> tag under the <kw> tag (i.e. sub steps) will be ignored and will not be imported into QMetry. |
Supported Fields
Field Name as mentioned in QMetry > Customization > Manage Fields > Field Name
For Look up list and multi lookup list fields
If the value does not exist in Project and Auto Create value feature is on for Project, the value will get added in the list and it will be assigned to the test case.
If the value does not exist in Project and Auto Create value feature is off for Project, the value will not be added in the list and Test Case field will be blank or have default value in it.
If a new value is added to Multi Look Up List, the older value will remain unchanged and the new value will be added to the list.
List values are added to the same version of the test case.
Field | Example | Test Case | Test Suite | Notes |
|---|---|---|---|---|
"component" | "component" : ["Label1, "Label2"] | Yes | No | Old values will persist and new value will get set e.g., L1 and L2 are set and L3 is assigned, then the updated values for component will be L1, L2 and L3.
|
"priority" | "priority" : "Minor" | Yes | No | As mentioned for Look Up and Multi Look Up lists above. |
"testCaseState" | "testCaseState":"Open" | Yes | No | |
"testCaseType" | "testCaseType":"UI" | Yes | No | |
"testcaseOwner" | "testCaseType":"John" | Yes | No | userAlias should be passed in request. Owner will not be set if the requested user is not found or the user doesn't have right for the Test Case module. |
"description" | "description":"Sample Description." | Yes | Yes | This will be set as requested. |
"estimatedTime" | "estimatedTime":6 | Yes | No | This will be set as requested (in minutes). |
"testSuiteState" | "testSuiteState":"Open" | No | Yes | A new Status value will be added if it does not exist in the project. |
"testsuiteOwner" | "testsuiteOwner":"lizamathew" | No | Yes | userAlias should be passed in request. Owner will not be set if the requested user is not found or the user doesn't have right for the Test Suite module. |
User Defined Fields
Custom Field Type | Validation Rule | Example | Notes |
|---|---|---|---|
STRING | It accepts text in a single line | "tagName": "Sample test asset." | The field value will be set as requested. |
NUMBER | It accepts any number with decimal | "executionTime": 4 | The field value will be set as requested. |
MULTILOOKUPLIST | It accepts comma separated multiple values | "langaugePreference": ["English",Portuguese"] | Multi Lookup will be set as requested if its list value exists.
|
LOOKUPLIST | It accepts a single value on the list | "country": ["United States"] | Lookup type will be set as requested if its list value exists.
|
LARGETEXT | It accepts text in multiple lines | "additionalComment": "this is a sample test asset" | The field value will be set as requested. |
DATEPICKER | It accepts the Date format that has been set in user profile | "reviewedDate": "08-30-2019" | The field value will be set as requested. |
Test Case Fields with UDFs in JSON format
|
Test Suite Fields with UDFs in JSON format
|
Back to QMetry All Products Help Page