Vous êtes sur la page 1sur 23

30-1-2019 Integrating Ranorex Test Cases into Jira

Home (https://www.ranorex.com/) › Blog (https://www.ranorex.com/blog/) › Integrating


Ranorex Test Cases into Jira

Integrating Ranorex Test Cases


into Jira
by Tobias Walter (https://www.ranorex.com/author/twalter/) | Oct 26, 2018 | Integration
(https://www.ranorex.com/blog/category/integration/)

Share article: (/#facebook) (/#twitter) (/#linkedin)

Jira  (https://www.atlassian.com/so ware/jira)is an issue and project tracking solution from


Atlassian. This article describes how to integrate Ranorex Studio with Jira, so that Ranorex
Studio can automatically create or modify testing issues in Jira. This integration works with
both a local Jira server as well as cloud instances, and is possible because Jira offers a REST
web service
Accepting (API
cookies letsdescription
us improve youravailable  hereFor more information, please read our Privacy Policy (/privacy-policy/).
User experience.
(https://developer.atlassian.com/cloud/jira/platform/rest/)
Yes, I accept Decline ).
https://www.ranorex.com/blog/integrating-ranorex-test-cases-into-jira/ 1/23
30-1-2019 Integrating Ranorex Test Cases into Jira

Use cases:
This integration supports the most essential use cases for a Ranorex Studio/Jira integration, as
listed below:

Create an issue when a test case fails


Re-open an old issue for a repeated failure
Close an issue when the related test case succeeds

In addition, this integration provides automatic issue handling, so that you aren’t required to
manually copy and assign the Jira issue key to the Ranorex Studio test case each time that an
issue is created in Jira.

Finally, the whole integration is customizable and works on both Jira server and Jira cloud
installations.

Structure of the integration


So that you have a single point of control, the integration is designed with a central default
configuration, where you can specify the starting values necessary for a running integration.
These default values can then be modified as necessary throughout the test execution.

In addition to the default configuration, the integration provides a single module that handles
the entire integration. Place this module in the teardown section of the test case for which you
want to create a Jira issue.

To modify the settings and values in the default configuration, the integration provides a user
code library, allowing you to simply use existing user code actions in the action table.

To provide automatic issue handling, the integration uses a Jira custom field that stores
information about the test case.

Accepting cookies lets us improve your User experience. For more information, please read our Privacy Policy (/privacy-policy/).
Yes, I accept Decline
https://www.ranorex.com/blog/integrating-ranorex-test-cases-into-jira/ 2/23
30-1-2019 Integrating Ranorex Test Cases into Jira

Watch our on-demand webinar


Mastering Jira integration with Ranorex Studio: Learn how to
configure the integration and understand typical use cases.

View now (/automated-testing-
webinars/mastering-jira-
integration/)

Getting started

Add the integration to you Ranorex Studio project


A NuGet package (https://www.nuget.org/packages/Ranorex.Jira/) with predefined Ranorex
Studio modules and user code actions is available from the Ranorex NuGet package manager.
To add the NuGet package to your Ranorex Studio project, follow these steps:

1. Right-click on your project in the Ranorex Studio project view


2. Select Manage Packages…
3. Search for Ranorex.Jira and add the Ranorex Jira reporting modules package

Accepting cookies lets us improve your User experience. For more information, please read our Privacy Policy (/privacy-policy/).
Yes, I accept Decline
https://www.ranorex.com/blog/integrating-ranorex-test-cases-into-jira/ 3/23
30-1-2019 Integrating Ranorex Test Cases into Jira

In the background, the package manager installs the Jira integration package and all
dependency packages (e.g. the Atlassian SDK). You can have a look at them when switching to
the Installed tab in the Ranorex NuGet package manager dialog. All necessary resources will be
added automatically to your test automation project.

A er adding the integration package to your project, there will be a new Jira folder available in
the module browser view. This folder contains two modules, one for setting up the
configuration and one for automatically handling the whole integration magic.

Accepting cookies lets us improve your User experience. For more information, please read our Privacy Policy (/privacy-policy/).
Yes, I accept Decline
https://www.ranorex.com/blog/integrating-ranorex-test-cases-into-jira/ 4/23
30-1-2019 Integrating Ranorex Test Cases into Jira

Note: There will also be a legacy folder in the module browser view which contains the
modules from the former community-driven project. If you are using the modules from the
former community project, we strongly recommend updating to the new implementation,
relying on these two modules and additional user code actions.

Add the default configuration to your test suite


To begin, add a setup region to your test suite:

Accepting cookies lets us improve your User experience. For more information, please read our Privacy Policy (/privacy-policy/).
Yes, I accept Decline
https://www.ranorex.com/blog/integrating-ranorex-test-cases-into-jira/ 5/23
30-1-2019 Integrating Ranorex Test Cases into Jira

To add the module to the test suite, simply drag and drop the module
InitializeDefaultConfiguration from the module browser view to the newly-created setup
region.

Accepting cookies lets us improve your User experience. For more information, please read our Privacy Policy (/privacy-policy/).
Yes, I accept Decline
https://www.ranorex.com/blog/integrating-ranorex-test-cases-into-jira/ 6/23
30-1-2019 Integrating Ranorex Test Cases into Jira

Open the global parameters tab of the test suite properties by right-clicking the added module
and selecting data binding. Click the Auto-create button to create parameters for all module
variables, and then click the Auto-bind button to bind the newly created parameters to the
variables.

Accepting cookies lets us improve your User experience. For more information, please read our Privacy Policy (/privacy-policy/).
Yes, I accept Decline
https://www.ranorex.com/blog/integrating-ranorex-test-cases-into-jira/ 7/23
30-1-2019 Integrating Ranorex Test Cases into Jira

A er that, you can start initializing the integration by entering values for the given parameters.

Required variables:

EnableJiraIntegration: The default value of EnableJiraIntegration is false. Please specify a


boolean value (True/False) to enable it. Otherwise, a warning will appear in the report. This
parameter is intended to enable the plugin during CI usage and keep it disabled when
maintaining or extending the test suite.
JiraUserName: The username to connect to the Jira server. For a cloud instance, enter the
user’s email address.
JiraPassword: The password for the specified user.
JiraServerURL: The URL for the Jira server.
JiraProjectKey: The project key as specified in Jira (e.g. TES).
JiraIssueType: An issue type, as available in Jira (e.g., Bug).
StateClosed: The state which will be set when an issue will be closed (e.g., Done).
StateReopen: The state which will be set when an issue will be reopened (e.g., In Progress).

Special field:

RxAutomationFieldName This fields enables an automatic issue treatment by Ranorex.


When a test fails, Ranorex Studio searches for an existing issue in Jira where the test case
name matches the content of this field. If an issue is found, it is reopened. Otherwise, a new
issuecookies
Accepting is created
lets usand theyour
improve testUser
case name For
experience. is stored in the issue
more information, pleasewithin
read ourthis field,
Privacy so (/privacy-policy/).
Policy that Ranorex
Yes, I accept Decline
https://www.ranorex.com/blog/integrating-ranorex-test-cases-into-jira/ 8/23
30-1-2019 Integrating Ranorex Test Cases into Jira

can associate the issue with the test case in the future.Important: A custom field with its
name matching the value of this variable must be created in Jira manually!

Other variables:

JiraSummary: Default summary text for the issue.


JiraDescription: Default description text for the issue.
JiraLabels: One or more default labels for the issue separated by “;” (e.g., Mobile; USB;
Connection).
jiraIssuePriority: Default value for the issue priority.
jiraEnvironment: Default value for the environment field.
jqlQueryToConnectIssues: Default JQL query to find issues.

Enable the integration for a Ranorex Studio test case


A er setting up the default configuration, create a test case which adds a Jira issue when it fails.
To do so, simply add a teardown region to a test case in your test suite in the same way that you
added the setup region previously.

Accepting cookies lets us improve your User experience. For more information, please read our Privacy Policy (/privacy-policy/).
Yes, I accept Decline
https://www.ranorex.com/blog/integrating-ranorex-test-cases-into-jira/ 9/23
30-1-2019 Integrating Ranorex Test Cases into Jira

Now add the module AutoHandleJiraIntegration by simply dragging and dropping it from the
module browser view to the newly-created teardown region.

Accepting cookies lets us improve your User experience. For more information, please read our Privacy Policy (/privacy-policy/).
Yes, I accept Decline
https://www.ranorex.com/blog/integrating-ranorex-test-cases-into-jira/ 10/23
30-1-2019 Integrating Ranorex Test Cases into Jira

Try out the integration


When you execute the test suite, nothing will be sent to Jira because the test case does not fail.
In order to test the integration, you can intentionally force a test case to fail. To do so, open the
underlying recording module and simply add a log message with the report level Failure.

Run the test suite again, and the report will show a failure in the test case where you’ve added
the log message. If you now open the teardown region of the test case, you will see a log
message reporting
Accepting cookies that a new
lets us improve Jiraexperience.
your User issue hasForbeen created, followed
more information, please readby
ouraPrivacy
directPolicy
link(/privacy-policy/).
to the
newly-created issue. Yes, I accept Decline
https://www.ranorex.com/blog/integrating-ranorex-test-cases-into-jira/ 11/23
30-1-2019 Integrating Ranorex Test Cases into Jira

Following the link, you will find a newly-created unresolved Jira issue with an attached Ranorex
Studio report containing the information about the failing test case.

Accepting cookies lets us improve your User experience. For more information, please read our Privacy Policy (/privacy-policy/).
Yes, I accept Decline
https://www.ranorex.com/blog/integrating-ranorex-test-cases-into-jira/ 12/23
30-1-2019 Integrating Ranorex Test Cases into Jira

When re-running the test, the integration will add a new issue.

To overcome this, you can use a custom single line filed in Jira. Let’s call it RxAutomation.

Note: A custom field can be created by a Jira administrator.

Simply configure this custom field in the default configuration, as shown in the image below.

Accepting cookies lets us improve your User experience. For more information, please read our Privacy Policy (/privacy-policy/).
Yes, I accept Decline
https://www.ranorex.com/blog/integrating-ranorex-test-cases-into-jira/ 13/23
30-1-2019 Integrating Ranorex Test Cases into Jira

A er configuring this RxAutomationFieldname, the name of the test case will automatically be
applied as an identifier of the issue. So every time that the auto-handle module triggers an
update, the integration checks whether there are one or more issues where the text in the
field RxAutomation matches the test case name and updates the issue(s) if necessary.

When you repeat test runs, instead of creating an issue for every failing test case, the Jira
integration automatically handles the updates on the existing issue(s).

Allow the test case to succeed by changing the log message from failure to success, and the
issue will automatically be updated to the status done, since the error no longer occurs.

Accepting cookies lets us improve your User experience. For more information, please read our Privacy Policy (/privacy-policy/).
Yes, I accept Decline
https://www.ranorex.com/blog/integrating-ranorex-test-cases-into-jira/ 14/23
30-1-2019 Integrating Ranorex Test Cases into Jira

Since the basic integration relys on just two modules, that’s all that is necessary!

Advanced Usage
The integration package includes a collection of user code actions in a user code library. These
user code actions can easily be added to your recording modules.

Begin by adding a new test case: simply copy the existing one and give it the name
TestCaseAdvanced.

Create a new recording module and add a user code action by selecting it from the user code
library, as shown in the image below.

Accepting cookies lets us improve your User experience. For more information, please read our Privacy Policy (/privacy-policy/).
Yes, I accept Decline
https://www.ranorex.com/blog/integrating-ranorex-test-cases-into-jira/ 15/23
30-1-2019 Integrating Ranorex Test Cases into Jira

There are two classes defined by the integration, described below.

The JiraFieldHelper provides functionality to:


Accepting cookies lets us improve your User experience. For more information, please read our Privacy Policy (/privacy-policy/).
Add or remove values from fields Yes, I accept Decline
https://www.ranorex.com/blog/integrating-ranorex-test-cases-into-jira/ 16/23
30-1-2019 Integrating Ranorex Test Cases into Jira

Set values in fields


Set the values custom fields
Set a specific issue key
Set JQL queries

The second class, ValueExtractorHelper, provides actions to:

Update the description of the issue with all steps performed in the raising test case
(including screenshots)
Update the issues summary tag by appending the error message

For example, if you want to add a new label, simply choose the user code action addNewLabel
and define the label as an argument of the action.

Make sure that the recording module is placed before the auto-handle Jira integration module
in the test suite.

Starting the test run will result in an added label to the newly-created Jira issue linked to the
test case TestCaseAdvanced.

Accepting cookies lets us improve your User experience. For more information, please read our Privacy Policy (/privacy-policy/).
Yes, I accept Decline
https://www.ranorex.com/blog/integrating-ranorex-test-cases-into-jira/ 17/23
30-1-2019 Integrating Ranorex Test Cases into Jira

If you are not able to add a custom field to your Jira instance, you can also use the
setJiraIssueKey action to define the specific issue you want to update. You can even use a JQL
query utilizing the action setJiraJQLQuery to define a set of Jira issues which should be
updated.

To give even more information about why the test case has failed, you can add the actions
updateSummary and updateDescriptionWithAllStepsMade to a recording.

Accepting cookies lets us improve your User experience. For more information, please read our Privacy Policy (/privacy-policy/).
Yes, I accept Decline
https://www.ranorex.com/blog/integrating-ranorex-test-cases-into-jira/ 18/23
30-1-2019 Integrating Ranorex Test Cases into Jira

This will extend the summary field of the Jira issue with the error message that forced the test
case to fail, and also add the entire report of the test case to the description of the issue,
including all screenshots.

Of course, all of these user code actions can also be utilized directly from code, if you prefer the
code-based approach.

To learn more about the Jira integration check out the free on-demand webinar “Mastering Jira
Integration (/automated-testing-webinars/mastering-jira-integration/)“, or visit the project
page (https://github.com/ranorex/Ranorex-Jira-Integration) on GitHub.

To explore the features of Ranorex Studio risk-free download a free 30-day trial today, no credit
card required.

Download Free Trial (/Free-Trial)

Accepting cookies lets us improve your User experience. For more information, please read our Privacy Policy (/privacy-policy/).
Enjoy this article? Don’t forget to share! Yes, I accept Decline
https://www.ranorex.com/blog/integrating-ranorex-test-cases-into-jira/ 19/23
30-1-2019 Integrating Ranorex Test Cases into Jira

(/#facebook) (/#twitter)

(/#linkedin)

You might also like these articles

(https://www.ranorex.com/blog/git-integration-in-ranorex/)
Git Integration in Ranorex (https://www.ranorex.com/blog/git-integration-in-
ranorex/)
Version control your automated tests with Git. Many have requested it, it’s been truly long
awaited and finally it’s here: the Ranorex Studio Git integration. Ranorex 6.0 gives you full
access to...

Accepting cookies lets us improve your User experience. For more information, please read our Privacy Policy (/privacy-policy/).
Yes, I accept Decline
https://www.ranorex.com/blog/integrating-ranorex-test-cases-into-jira/ 20/23
30-1-2019 Integrating Ranorex Test Cases into Jira

(https://www.ranorex.com/blog/5-testing-challenges-when-using-selenium/)
5 Common Challenges When Using Selenium (https://www.ranorex.com/blog/5-
testing-challenges-when-using-selenium/)
Troubles identifying dynamic content or handling timing issues with Selenium? Find out how
you can easily solve 5 of the most common Selenium challenges!

Latest Popular Categories

Travis CI Joins the Idera Family of Testing Tools


(https://www.ranorex.com/blog/idera-acquires-
(https://www.ranorex.com/blog/idera-travis-ci)
acquires-travis-ci)

Multi-Phase GUI Testing with Ranorex under Cloud-


Based CI/CD Part 4: Testing
(https://www.ranorex.com/blog/cloud-(https://www.ranorex.com/blog/cloud-based-
based-testing4) testing4)

Accepting cookies lets us improve your User experience.Multi-Phase GUI Testing


For more information, with
please read ourRanorex under
Privacy Policy Cloud-
(/privacy-policy/).
Yes, IBased
accept CI/CD Part 3: Deployment
Decline
https://www.ranorex.com/blog/integrating-ranorex-test-cases-into-jira/ 21/23
30-1-2019 Integrating Ranorex Test Cases into Jira

(https://www.ranorex.com/blog/cloud-(https://www.ranorex.com/blog/cloud-based-
based-testing3) testing3)

Ranorex Studio a Leader in the G2 Crowd Grid


for Test Automation
(https://www.ranorex.com/blog/g2crowd-(https://www.ranorex.com/blog/g2crowd-grid-
grid-test-automation-2019) test-automation-2019)

Follow us!
(https://www.facebook.com/Ranorex/) (https://twitter.com/ranorex)
(https://www.linkedin.com/company/ranorex-gmbh)

Product

User Guide (/help/latest/)


Get yourself certified (/certification/)
Ranorex User Voice (/uservoice/)
Product Roadmap (/product-roadmap/)
Beta Program (/beta-program/)
Release Notes (/release-notes/)
Newsletter (/newsletter/)
Popular Links

Test Automation Tools (/test-automation-tools/)


Functional Testing (/automated-functional-testing/)
Why Test Automation (/why-test-automation/)
GUI Testing Tools (/automated-gui-testing-tools/)
Regression Testing Tools (/regression-testing-tool/)
Quality Assurance Testing Tools (/qa-testing-tools/)
Black Box Testing (/black-box-testing-tools/)
Keyword-Driven Testing (/keyword-driven-testing/)
Jenkins Test Automation (/jenkins-automated-testing-tools/)
Data-Driven Testing (/data-driven-testing/)
European Headquarters

Ranorex GmbH
Strassganger Strasse 289
Accepting
8053 Graz,cookies lets us improve your User experience. For more information, please read our Privacy Policy (/privacy-policy/).
Austria
Yes, I accept Decline
https://www.ranorex.com/blog/integrating-ranorex-test-cases-into-jira/ 22/23
30-1-2019 Integrating Ranorex Test Cases into Jira

 +43 316 28 13 28 (tel:+43 316 28 13 28)


✉ sales@ranorex.com (mailto:sales@ranorex.com)

US Headquarters

Ranorex Inc.
2950 N Loop Freeway W, Ste 700
Houston, TX 77092, USA

 +1 727 835 5570 (tel:+1 727 835 5570)


✉ sales.us@ranorex.com (mailto:sales.us@ranorex.com)

(https://www.facebook.com/Ranorex/) (https://twitter.com/ranorex)
(https://www.linkedin.com/company/ranorex-gmbh)
(https://www.youtube.com/user/RanorexChannel)
(http://feeds.feedburner.com/ranorex) (http://de.slideshare.net/Ranorex)

Legal Notice (/legal-notice/) | Licensed Patents (/licensed-patents/) | Terms of Use (/terms-of-use/) |


Privacy Policy (/privacy-policy/) | GDPR Commitment (/gdpr-commitment/) | Copyright Infringement
Notification (/copyright-infringement-notification/) | Deutsch (https://www.ranorex.com/de/)

© 2018 Ranorex GmbH. All Rights Reserved

Accepting cookies lets us improve your User experience. For more information, please read our Privacy Policy (/privacy-policy/).
Yes, I accept Decline
https://www.ranorex.com/blog/integrating-ranorex-test-cases-into-jira/ 23/23

Vous aimerez peut-être aussi