JIRA Load Testing Tutorial – Create an Issue with Flood Element

Atlassian’s JIRA Software is used for issue tracking and project management by over 125,000+ teams worldwide. It can be used as either an on-premise or hosted cloud solution with various options to scale it from ten users to tens of thousands.

JIRA is often the single source of truth for everything from ideation to production monitoring within an enterprise.  It’s not uncommon for a single instance of JIRA to be loaded up with millions of issues logged by thousands of concurrent users. Given the importance and volume of transactions, JIRA needs to be able to scale so that business can continue to run smoothly without interruption.

With this in mind, we decided to showcase how load testing your JIRA deployment can be done easily using Flood Element for simple scripting of many common functional process available in the software.  In this post, you will see how you can easily test the creation of a JIRA project issue, in just a matter of minutes.

What is a JIRA Issue?

In JIRA, issues are the core object that tracks individual pieces of work that needs to be carried out by individuals.  Issues can cover a wide variety of processes such as feature requests, project requirements or defect reports. A typical issue lifecycle takes the form as per below:

Why use Flood Element for JIRA Load Testing?

Atlassian provides recommendations for load testing tools that work with JIRA.  Flood supports these tools as they are widely known throughout the industry.  However, when it comes to JIRA, our customers find that Flood Element is a better tool than these mentioned because: 

  1. The browser based architecture makes it easy to measure full page load times, including rendering of 3rd party JIRA apps
  2. The black box approach means you don’t have to understand the complexities of the architecture like load balancers, API’s, or integrations to write an effective test
  3. The familiar Typescript based framework is easy for any developer to pick up, and it is similar to other testing frameworks like Selenium

So, in this post we are going to focus specifically on how you can quickly train up on Flood Element to get started load testing your JIRA instance.

Load Testing the JIRA Issue process

Before jumping in to the tutorial, we recommend installing Flood Element and a compatible IDE, such as Microsoft VSCode.  You can familiarize yourself with Flood Element in our documentation or blog posts.

We’ll start creating a Flood Element script to mimic a real user creating an issue for one their projects end to end. We’ll be following the steps outlined below:

  1. Navigate to the JIRA SSO portal
  2. Enter username and password and login
  3. Navigate to the projects area
  4. Select a specific project
  5. Create a new issue
  6. Enter all issue details interacting with a number of UI components
  7. Submit the issue

Step 1. Navigate to the JIRA SSO portal

Every hosted JIRA deployment will have a customized URL such as yourcompany.atlassian.com and require you to sign in with your credentials. This can be easily done using a simple navigate statement.

await browser.visit('http://flood-demo.atlassian.net', { waitUntil: 'load' })

This will simply navigate to the hosted JIRA deployment and wait until the sign-in page loads. It’s also a good idea to add a text verification check to enable us to verify we are on the correct page and that it has loaded successfully.

let pageTextVerify = By.visibleText("Log in to your account")
await browser.wait(Until.elementIsVisible(pageTextVerify))

Step 2. Enter Username and password information

Entering your username on a standard JIRA SSO login page is fairly simple. The username input field can be referred to by its CSS ID #username as follows:

await browser.type(By.css('#username'), "j.rizio@tricentis.com")

We’ll also need to click on the Continue button to get to the next step which is entering the password for this account.

let btnContinue = await browser.findElement(By.css('#login-submit > span > span'))
await btnContinue.click()

This will bring us to the password entry screen and we’ll enter the password just as we did for the username.

await browser.type(By.css('#password'), "Password123")

Again we’ll need to click on the Sign-in button so we can authenticate successfully and access our JIRA projects.

let btnLogin = await browser.findElement(By.css('#login-submit > span > span > span'))
await btnLogin.click()

The last statement we’ll add to this step is another text verification point – again so we ensure we have logged in successfully.

let pageTextVerify = By.visibleText("Welcome to Jira")
await browser.wait(Until.elementIsVisible(pageTextVerify))

Step 3. Navigate to the projects area

We now have access to the main JIRA portal – we’ll need to head over to the projects area so we can access our specific project that we want to create an issue against.

let btnProjects = await browser.findElement(By.xpath("//a[contains(@href, 'BrowseProjects')]"))
await btnProjects.click()

We find the Projects link element a little bit differently with this statement. It depends on the application but often the properties for an element are not exactly readable and can be buried under a mountain of CSS.

In this case, the link to the projects area had a nice unique name that included ‘BrowseProjects’ in the URL so we’ve chosen this for Flood Element to use as identification.

Essentially we let Flood Element know that we are looking for a link which has a href url that contains BrowseProjects. You can use this contains xpath method for any property which makes it incredibly useful.

We’ll also add another text verification point to complete the step.

let pageTextVerify = By.visibleText("Projects")
await browser.wait(Until.elementIsVisible(pageTextVerify))

Step 4. Select a specific project

We’ll now select our specific JIRA project called jira-load-test from the list of available projects. Again with readability in mind – we can also let Flood Element click on a link based on visible text that’s showing on the page.

That statement looks like the following:

let btnProjects = await browser.findElement(By.visibleText('jira-load-test'))
await btnProjects.click()

We also have a partialVisibleText method available which can find an element on a link that contains specified partial text.

Step 5. Create a new issue

In JIRA, we simply use the + symbol on the left hand toolbar to create a new issue. This can done using the following statement:

let btnCreate = await browser.findElement(By.xpath("//span[contains(@aria-label, 'Create (c)')]"))
await btnCreate.click()

Here, we are using the aria-label property which has the value Create (c) to identify and click the button.

The issue details form should appear and we can verify this by using yet another text verification point as follows:

let pageTextVerify = By.visibleText("Create issue")
await browser.wait(Until.elementIsVisible(pageTextVerify))

Step 6. Entering the issue details

Within the Create issue form there are a number of different UI elements that we need to interact with.

let selIssueType = await browser.findElement(By.xpath("//input[contains(@id, 'issuetype-field')]"))
await selIssueType.focus()

The Issue Type field is essentially a really smart listbox. We can focus on the input field first so the element is activated and ready to use. We’ll also type in the value we want to select which is Bug – as follows:

await browser.type(By.css('#issuetype-field'), "Bug")
await browser.press(Key.ENTER)

This will filter out all issue types except for the one we want and then we press the ENTER key to confirm the selection.

For the issue Summary – this is just a simple text entry field and we can enter text into it with the following statement:

await browser.type(By.css('#summary'), "There is a bug in the application")

Again for the Description field which is another text entry field we can enter text into it in the same way:

await browser.type(By.css('#description'), "There is a bug in the application and this is the description")

The priority field can be specified in a similar way to the issue type field as follows:

await browser.type(By.css('#priority-field'), "Low")
await browser.press(Key.ENTER) 

The labels text area allows you to specify numerous values that can be existing or new. We’ll add a couple in the next few statements.

await browser.type(By.css('#labels-textarea'), "bug-report")
await browser.press(Key.ENTER)  
await browser.type(By.css('#labels-textarea'), "defect")
await browser.press(Key.ENTER)

7. Submit the issue

The last step is to actually submit the issue and this can be done by clicking on the create issue submit button at the bottom of the form as follows:

let btnCreate = await browser.findElement(By.css('#create-issue-submit'))
await btnCreate.click()

This will submit the issue and close the Create issue form. This is also the end of the script functionality and you can run this exact script against your own JIRA environment.

Putting It All Together

We have collected all of these steps together into a complete script located in our example repository for Element.  Please feel free to download this script and use it for your own starting point to load test Creating issues in JIRA.

When you have a script created, you can run it locally or upload it into Flood to execute it with 100’s or 1,000’s of concurrent users.  The free trial will provide you with enough node hours to execute this Flood Element test outlined here for 15 minutes with roughly 1,000 concurrent users.

If you are load testing your JIRA environment, we’d love to hear from you.  Drop us a note and share any ideas that are working for you and feel free to ask our team any of your tough questions!

Ready to get started?

Sign up or request a demo today.