Author :
Zoran Dimitrovski
December 9, 2018
In this article, we'll describe the integration between the X-ray Test Management plugin for JIRA and the robot test automation framework that Jenkins uses. to help you likeintegration developer, we will work out the configurations that need to be done, so that the results of the automated execution of the tests implemented in the Robot framework can be transferred back to Xray/JIRA, where the tests are documented. All of these processes can be implemented with Jenkins work and performed without any manual intervention.
Introduction
Xray is one of the most popular test management tools for thesoftware STANDBY. Xray supports the entire test lifecycle: test planning, test design, test execution, and test reporting. Xray supports both manual and automated testing, including full compatibility with the Cucumber test. It has built-in support for various test automation platforms such as JUnit, TestNG, NUnit, Robot framework, as well as providing easy integration with CI platforms such as Jenkins, Bamboo or TeamCity. For more information about Xray, see the official documentation: https://confluence.xpand-it.com/display/XRAY/Xray+Documentation+Home
The robot framework is a popular test automation framework based on a keyword-based paradigm. The framework has a rich ecosystem around it, made up of various libraries and generic testing tools. For more details about Robot framework, refer to its official website:http://robotframework.org/.
Jenkins is the most popular open source continuous integration (CI) server, providing hundreds of plugins that allow integration with many different systems and/or frameworks, including the Xray and Robot framework.
This article is organized into three main sections: I'll introduce the first Xray test case organization into a sample project, then I'll introduce theJenkins Configurationwhich foresees the execution of the Robot test and, finally, the three different methods to import the results of the Robot's automated tests into Xray/JIRA will be elaborated.
Xray-compatible JIRA project example
Assume the system under test is e-commerce websitehttp://automationpractice.comand in Sprint 1 there are 5 user stories.
Figure 1: Sprint 1 user stories for the sample project
For each user story, tests are created in Xray. For example, for the XR-32 user story, three test cases are created in Xray:
Figure 2: X-ray tests associated with one of the sample project's user stories
The test plan is a type of custom JIRA issue provided by Xray that ensures better visibility and management of tests and can be thought of as a "wrapper" for tests related to a specific version of the system under test. We didn't go into detail on how the test plan is created (for more details on how to create a test plan using Xray, see:https://confluence.xpand-it.com/display/XRAY/Test+Plan), suppose a test plan is created with all the tests from the Sprint1 user stories:
Figure 3: Example of X-ray Test Plan
Test Run is another custom issue type provided by Xray which tracks multiple Test Runs i.e. it is made up of multiple Test Runs. From the Test Plan it is possible to create one or more Test Runs for all or just a subset of the Tests contained in the Test Plan (for example, only the Tests that still fail). We won't go into detail on how the Test Execution is created (for more details on how to create the Test Execution using Xray, see:https://confluence.xpand-it.com/display/XRAY/Test+Execution), for the sample project, a test run associated with the Sprint 1 test plan is created.
Figure 4: X-ray test run example
Installing and configuring the Xray Jenkins plugin
Xray provides a plugin for Jenkins that allows you to import automated test execution results into JIRA. The Xray Jenkins plugin can be downloaded from:https://confluence.xpand-it.com/download/attachments/35356981/xray-for-jira-connector.hpi?version=1&modificationDate=1532097682950&api=v2
To install the Xray Jenkins plugin, go to Manage Jenkins > Manage Plugins and select the Advanced tab. In the Upload Plugin section, click Upload and select the location where you downloaded the xray-for-jira-connector.hpi file.
Figure 5: Installing the Xray Jenkins plugin
Also, you need to configure the Xray plugin to communicate with JIRA. To do this, go to Manage Jenkins > Configure System > Xray Configuration for Jira. The server address field is populated with the URL of the Jira server where Xray is running, while the username and password should be the JIRA admin credentials:
Figure 6: Communication setup between Jenkins and JIRA where Xray is running
Configuring Jenkins job for automated test execution and reporting results to Xray-JIRA
The Jenkins work that will be created is a freestyle project called Xray Robot Integration Demo:
Figure 7: Create Jenkins job
For the purpose of this article, eight tests were developed in the already defined Robot for Testing on Xray framework. In this case, the custom workspace will be used and the specified directory is where the robot tests are placed.
Figure 8: Jenkins Job Configuration - Workspace Specification
To run automated tests, you can use the Windows batch command:
Figure 9: Jenkins job setup - Robot test run
And finally, to pass test execution results from Robot to Xray, like "Xray: Result Import Task" that comes with Xray Jenkins plugin, it must be set as post-build action.
Figure 10: Jenkins job configuration - post build action
After creating the Xray: Results Import Task, in the JIRA Instance field you can choose which server the JIRA results will be sent to. The Xray plugin allows you to configure multiple JIRA servers in the Xray for JIRA configuration in the Jenkins configuration. In this case, only one JIRA server is configured and the displayed JIRA instance is set as the configuration alias (see Figure 6). The Format drop-down menu lists reports from different test frameworks that can be imported into Xray.
Figure 11: X-Ray - Results Import Task
In our case, the Robot XML format will be used and the import task must be configured with the following parameters:
- Import into the same test run – When this option is checked, if you are importing multiple run report files using a global expression, the results will be imported into the same test run.
- Run report file (file path with file name) - Location and name of Robot Framework test output file. The location must be specified relative to the defined workspace
- Project key: JIRA project key. This is a required parameter, if not specified test results will not be imported into JIRA
- Test Run Key – JIRA issue key of the test run where the results will be imported. If this parameter is not specified, after importing the results, a new test run will be created in JIRA.
- Test plan key – Test plan JIRA issue key. If this parameter is not specified, the imported test run will not be associated with any test plans.
- Test environments: list of environments (separated by ",") where tests are executed.
Figure 12: Xray - Result Import Task - Configured for Robot Framework
On the other hand, the necessary configuration for the Robot tests to associate them with a certain Test in Xray/JIRA is very simple, that is, you must add a tag in the Robot test case that corresponds to the Test key in the TOUR. For example, in the test case in the figure below, "Create account" is marked with XR-2, while "Place order paid by bank transfer" is marked with XR-27, where XR-2 and XR-27 are Test keys already created. in X-rays/JIRA.
Figure 13: Association of robot test cases with test key in Xray/JIRA, using tags
In the following text, three different ways to import automated test results into Xray/JIRA will be presented.
1. Run the Jenkins job with test execution set
Let's examine what the imported robot's test results look like when in "Xray: Import Results Task" the test run key is set. To illustrate this, let's assume that before the Robot tests are executed, a Test Run has already been created in JIRA X-50, and the import task is configured as shown in Figure 12.
Once the Jenkins job completes and the bot results are imported into JIRA automatically, the test status is updated on the corresponding test run (in this case, XR-50). Also for the test environment tag it is set to the value "QA" as defined in the import task.
Figure 14: Test run created before automated test run and after robot test results are imported
2. Run the Jenkins job without a defined test run
Another option is automated bot tests that will run in Jenkins without first creating a test run in JIRA. To do this, the Test Run Key field in “Rayos: Result Import Task” must be left blank.
After the Jenkins job is complete, if we browse JIRA for the associated test plan, we can see that an additional test run (XR-51) is automatically added:
Figure 15: Test plan with the two associated test runs
3. Importing tests and test execution results from automated robots, when tests are not defined in Xray
An interesting feature of Xray is that tests can be created in JIRA based on just importing test results from Robot's automated test execution. Please note that our tests are only created in Robot and there are no corresponding tests created in Xray/JIRA.
In order for bot test cases to be assigned to a specific user story in JIRA, bot test cases must be tagged with the user story they are testing. For example, in the image below, the "Create Account" bot test case verifies the XR-1 user story, while the "Place order paid by bank transfer" and "Place order paid by check" bot tests verify the user XR-26 history.
Figure 16: Associating bot test cases with the user story key in JIRA using tags
In this case, the "minimal" configuration will be used for the import task in the post-build action in the Jenkins job, i.e. only the JIRA project environment and key will be configured, which is optional.
Figure 17: Xray - Results Import Task - Minimal configuration when tests are not created in Xray/JIRA prior to automated test execution
After Jenkins runs the tests, new tests are created, which are automatically associated with the user stories, based on the tags that were added in the Robot test cases. For example, in the case of an XR-32 user story, three Tests from the executed Robot test cases are automatically associated.
Figure 18: Tests associated and created "automatically" after the execution of the robot tests
Furthermore, after executing the tests, a new test is created with all the robot's tests executed. (Note that the test type in this case is "Generic". Xray supports three different test types: "Generic" - supports automated agnostic tests that are run by an external tool, "Cucumber" - allows you to write tests in the Gherkin language, and "Manual." - Allows you to write tests in the standard description/expected result format for manual execution)
Figure 19: Test run created after running the robot tests
Under Test Execution, you can navigate to Execution Details for each of the tests. For example, if we navigate to XR-53 Test Execution Details, we can see the test status for each of the keywords contained in the executed bot test.
Figure 20: Execution details with keywords of the executed Robot test
Comparing the three methods mentioned above for importing automated test results, it seems that method 2 is the most applicable as it automatically creates the Test Execution in Xray/JIRA when running the automated tests and associates the results with the corresponding Test Plan. On the other hand, when comparing method 2 with method 3, the disadvantage of method 3 is that it does not create any test plan associated with automated test execution. The main advantage of method 3 - automatic creation of tests in XRay/JIRA, in most situations it will not be applicable, as most likely there are tests already defined for manual tests, before the implementation and execution of automated tests.
Conclusion
X-Ray Test Management Plugin for JIRA provides all necessary artifacts for entire test lifecycle in case of manual testing, it provides strong support for automated testing with its support for importing results from different test frameworks. test automation, such as the Robot test framework. This possibility avoids the need to “manually” import the results of automated tests. Overall, Xray simplifies all test management, tracking and reporting by providing a central point – JIRA – where all test information relevant to a specific project can be found.
Author
Zoran Dimitrovski
Zoran's last 5 posts
- JIRA Test Management Plugins Comparison
Contact us:
FAQs
How do you integrate a cucumber with an X ray? ›
- Specify Cucumber tests using natural language, in Jira.
- Export Cucumber features from Jira to the CI environment, using the REST API.
- Implement tests in code and commit them to the source code versioning system.
- Execute tests in the CI environment.
- Report results to Xray, using the REST API.
In Jira settings, under Automation, create a new rule and define the "When" (meaning when it should be triggered ). Set it for "Manual trigger." 2. Next, define the condition so that this rule can only be executed from the Test Plan issue.
Is Robot Framework hard? ›Robot Framework is easy to install. Robot Framework is keyword-driven. Robot Framework allows the use of Gherkin. Robot Framework works for both mobile and web apps.
How do I get data from Excel to Robot Framework? ›To read data from we will include the following Library. Add robotframework-excellibrary-xwfintech (Lastest) instead of robotframework-excellibrary as it is not supported in certain cases. Do Include Selenium and Robot Framework. Read Cell Data By Coordinate is the function which will read the data from the cell.
Is Robot Framework better than selenium? ›There is a huge difference between both of them – Robot is a test framework that makes use of test libraries (standard & external) to execute tests, whereas Selenium is only a WebDriver/library that requires the support of test automation runners in order to perform test execution.
Is cucumber good for integration testing? ›This means that all parts of the agile testing pyramid can be implemented using Cucumber. You can can implement end-to-end tests, integration tests, and parts that could be tested using unit tests. The decision to use Cucumber or a unit testing framework is depending on the cooperation with the business.
Can we use cucumber for integration testing? ›And the Cucumber-Spring Integration is intended to make test automation easier. Once we have the Cucumber tests integrated with Spring, we should be able to execute them along with the Maven build.
How is cucumber used for testing? ›Cucumber testing is a software testing process that deals with an application's behavior. It tests applications as a behavior-driven development (BDD) style. Cucumber tests are written in a simple, natural language that anyone can understand, even people who are not technical experts.
How do you make test cases automatically? ›- In the Test Manager, select New > Test File > Test File from Model.
- In the dialog box, select the model that you want to generate test cases from. The model must be on the MATLAB® path.
- Select the test case type, and click Create.
It is impractical to automate all testing, so it is important to determine what test cases should be automated first. The benefit of automated testing is linked to how many times a given test can be repeated. Tests that are only performed a few times are better left for manual testing.
How do I pass all test cases in Jira? ›
Click the status button to drop down all of your test execution status options. If you select a status from that drop-down, it will set the entire test case to the selected status. Each step will still show Not Executed, but the test execution will show Passed.
Which language is used in Robot Framework? ›The framework is written using the Python programming language and has an active community of contributors.
Does Robot Framework require coding? ›As Robot Framework does not require the user to write a complicated piece of code, it is easy to learn and use the tool.
How do you explain Robot Framework in an interview? ›Explain Robot Framework Architecture? Robot Framework is an Independent framework that uses Keyword Driven Testing. All the users can create high level keywords from the existing keywords. Test Data is the First Layer used in maintaining data and inputting it to the Robot Framework.
How does robot framework connect to database? ›If you're using MS SQL Server, get the pymssql module, and then tell the Robot Framework Database library that you want to connect using pymssql. After that all you have to do is enter your hostname, username, password, and so on. It should be pretty straightforward.
How do I pull data from JSON to Excel? ›- Select Data > Get Data > From File > From JSON. The Import Data dialog box appears.
- Locate the JSON file, and then select Open.
- Select one or more cells you want to use as a basis for filling additional cells. For a series like 1, 2, 3, 4, 5..., type 1 and 2 in the first two cells. ...
- Drag the fill handle .
- If needed, click Auto Fill Options. and choose the option you want.
The robot framework is platform-independent, Although the core framework is implemented using python it can also run on JPython(JVM) and IronPython(. NET). The test data is in an easy-to-edit format when the process starts the framework processes the test data and generates logs and reports.
Is Robot Framework BDD or TDD? ›Robot Framework is a Python-based, extensible keyword-driven automation framework for acceptance testing, acceptance test driven development (ATDD), behavior driven development (BDD) and robotic process automation (RPA).
Which automation testing tool is easiest? ›- Selenium. Selenium is arguably the most popular automated software testing tool among web developers and testers. ...
- Appium. Appium is an automated software testing tool for use with native, hybrid, and mobile web apps. ...
- Katalon Studio. ...
- Cucumber. ...
- Eggplant Functional.
Which is better TestNG or Cucumber? ›
TestNG vs Cucumber: When to use which
When there is a need to test an important feature that needs to be understood by the business stakeholders, Cucumber can be used. To test a technically implemented complex business logic/algorithm where behavior is not a deciding factor TestNG can be used.
testjam.io is an online IDE for running and sharing Cucumber.
Can we use both Cucumber with TestNG? ›Cucumber can be executed in parallel using **TestNG and Maven test execution plugins** by setting the **dataprovider parallel option to true**. In TestNG the **scenarios and rows in a scenario outline are executed in multiple threads**. One can use either Maven Surefire or Failsafe plugin for executing the runners.
Is integration testing the same as BDD? ›So to recap Integration test Is a type of system testing. But BDD is a methodology to apply this test to your system. Finally, each methodology has its pros and cons you just need to choose which methodology that fits in your environment. They all aim to make your system stable and behaving as you wish.
Can we use both Cucumber and Selenium? ›Here are the benefits of using Selenium and Cucumber together for web application testing: Allows everyone involved in the development of the web app to thoroughly test the web app. Allows all the business stakeholders and developers to develop the web application together.
Can we use BDD for unit testing? ›In this article, we'll see how Behavior Driven Development / Acceptance Test Driven Development (BDD/ATDD) can apply all the way from the Customer / User Tests to Unit Tests. These are the tests in the left column of the matrix. To illustrate this process, I'll use the example of an on-line ordering system.
What is the difference between Cucumber and robot framework? ›Cucumber is a tool that supports Behaviour-Driven Development (BDD) - a software development process that aims to enhance software quality and reduce maintenance costs. On the other hand, Robot Framework is detailed as "A test automation framework for acceptance testing and ATDD".
What language is used by Cucumber? ›Gherkin is the language that Cucumber uses to define test cases. It is designed to be non-technical and human readable, and collectively describes use cases relating to a software system.
What is gherkin vs Cucumber testing? ›Gherkin is Cucumber's language parser, which allows software behaviours to be specified in a logical language that people can understand. This means that Cucumber feature documentation is written in business-facing text that is non-technical and human readable for stakeholders like business analysts and managers.
What is the best tool to write test cases? ›- Tricentis Tosca. ...
- TestLodge. ...
- QA touch. ...
- devZing. ...
- Zephyr. Best Jira Integration for Test Case Management. ...
- TestCaseLab. Best For Manual QA Testers. ...
- Test Collab. Best For Improving Communication Between Testers and Developers. ...
- TestRail. Best Test Case Management Tool for Collaboration.
How can you make test cases faster? ›
- Open URL under test utilizing Selenium Webdriver (local/remote)
- Making use of relevant web locators, locate the web elements.
- Perform assertions on located web elements on the page under test.
- Relieve the resources used by WebDriver.
Three ways to create test script are 1) Record/playback 2) Keyword/data-driven scripting, 3) Writing Code Using the Programming Language. Your test script should be clear and you should create a test script that should contain just one specific action for testers to take.
How many test cases can you automate per day? ›Q #35) How many test cases have you automated per day? Answer: Well, the number depends on the complexity of the test cases. When the complexity was limited, I was able to automate 5 to 6 test cases per day. Sometimes, I was able to automate only one test case for complex scenarios.
What are the 7 principles of testing? ›- Testing shows the presence of defects, not their absence. ...
- Exhaustive testing is impossible. ...
- Early testing saves time and money. ...
- Defects cluster together. ...
- Beware of the pesticide paradox. ...
- Testing is context dependent. ...
- Absence-of-errors is a fallacy.
- User experience tests for usability (tests that require a user to respond as to how easy the app is to use).
- Tests that you will only run one time. ...
- Test that needs to run ASAP.
- Tests that require ad hoc/random testing based on domain or subject matter expertise/knowledge.
- Run a search on the issue navigator to get all the issues that need to be exported (The example below contains 1000+ issues).
- Export the first 1000 issues using the standard export feature (Export > Export Excel CSV (all fields))
- Open the exported CSV files and manually consolidate them if necessary.
- Navigate to Project > Test Management > Test Executions.
- Click on the target Test Execution.
- Choose Test Case Execution. Configure Test Case Execution with Requirements and Test Management for Jira app.
Creating tests in Xray is easy. Hit the “create” button in the menu bar and choose the “Test” issue type. In the test details, you'll want to specify if it's a manual, generic or automated test. If the test is manual, you'll write the description, assign a version of your software and set the assignee and the reporter.
Is it easy to learn Robot Framework? ›Robot Framework is extremely easy to set up, use and modify to get both Android and iOS apps tested. The test syntax that it uses is based on keywords and these keywords are quick to edit and further configure to make a match with the application under test.
Is Robot Framework still used? ›Robot Framework and Selenium are widely used for testing web applications.
How do you write test cases in Robot Framework? ›
To create test case, right-click on the project. Click New Test Case. Enter the name of the test case and click OK. There are 3 tabs shown for the test case created − Edit, Text Edit and Run.
Is it hard to code a robot? ›How Hard Is It to Build Your Own Robot? Creating a robot is an interdisciplinary project, which makes it quite challenging. Even a basic robot for kids requires mechanical assembly and very basic programming skills. Despite this, building a robot is possible for anyone with enough motivation and willingness to learn.
Is coding a robot hard? ›Some people say that robot programming is difficult, but really the difficulty of programming is up to you. For example, many of our users just use the graphical interface and move the robot around in the simulation. But, you also can choose to use a more advanced programming language if you prefer.
What are the 3 different types of variables in the Robot Framework? ›There are three types of variables supported in robot framework − scalar, list and dictionary.
How do you pass test cases in coding test? ›- Keep things simple and transparent.
- Make test cases reusable.
- Keep test case IDs unique.
- Peer review is important.
- Test cases should have the end user or defined requirements in mind.
- Specify expected results and assumptions.
All you need to do is click and hold on the checkbox for 2-3 seconds and then release. This has always helped me pass the test without needing to pass any further tests.
How do you pass test cases in online coding test? ›Understand the Task and the Problem: Make sure you understand the task and the problem before you attempt to solve it. Create custom test cases so you can test, verify and correct your code before you hit submit. Develop a Strategy: Once you understand the problem, develop a plan to attack it.
How do you pass a list of variables in Robot Framework? ›- Scalar (Identifier: $) – The most common way to use variables in Robot Framework test data is using the scalar variable syntax like ${var}. ...
- List (Identifier: @) – If a variable value is a list or list-like, a list variable like @{EXAMPLE} is used.
40) How many test cases can we review per day? It would be around 7 test cases we write so that we can review 7*3=21 test cases. And we can say that 25-30 test case per day.
Do I have to pass all test cases? ›You will get that through practice. And yes it is necessary to pass all the test cases. For example take the hackerrank website where there are 100's of test cases to pass before you submit your code.
Can you beat a CAPTCHA? ›
Some bots can get past the text CAPTCHAs on their own. Researchers have demonstrated ways to write a program that beats the image recognition CAPTCHAs as well. In addition, attackers can use click farms to beat the tests: thousands of low-paid workers solving CAPTCHAs on behalf of bots.
What are the 3 laws in I robot? ›A robot may not injure a human being or, through inaction, allow a human being to come to harm. A robot must obey orders given it by human beings except where such orders would conflict with the First Law. A robot must protect its own existence as long as such protection does not conflict with the First or Second Law.
Why am I getting so many CAPTCHAs? ›Reasons why you might get multiple CAPTCHAs:
Your Internet Service Provider gave you an IP address that was previously used by hackers within the past few weeks, so our firewall is now mistaking you for a hacker. To fix this, reset your internet router, so you can get a new IP address.
- How do you reverse a string in Java? ...
- How do you determine if a string is a palindrome? ...
- Find the number of occurrences of a character in a String? ...
- How to find out if the given two strings are anagrams or not? ...
- How do you calculate the number of vowels and consonants in a String?
Coding interviews mainly comprise of data structure and algorithm related questions along with logical questions. Coding interview questions are related to array, linked list, string, binary tree, and questions from algorithms.
How do you check if a variable exists in Robot Framework? ›If it exists and its value is a variable name either in the normal or in the escaped syntax, variable with that name is created instead. For example, if ${name} variable would exist and contain value $example , these examples would create different variables: Set Suite Variable ${name} value # Creates ${example}.