Selenium Script to add users in JIRA.

Hello Friends,

This is one of the tutorials for Jira users who can use the Selenium script as an automation for adding the users in jira and updating the groups of the users. As you may know, adding the users in jira is a manual effort, and is a kind of repetitive task, so its always a ease to automate the repetitive work. Selenium is the one of the best alternative for removing the repetitive actions.

I have already covered the basics of Selenium in my previous post, click here to check. So, following is the java code which consists of the selenium script that will create the multiple users using the Selenium IDE.

package com.sample;

import com.thoughtworks.selenium.SeleneseTestCase;
public class AddUserInJira extends SeleneseTestCase
public void setUp() throws Exception
setUp(“http://localhost:8080/”, “*iexplore”);
// We instantiate and start the browser
public void testAddUserInJira() throws Exception
selenium.type(“id=login-form-username”, “jira_username”);
selenium.type(“id=login-form-password”, “jira_password”);“id=login”);
selenium.type(“id=login-form-authenticatePassword”, “jira_password”);“id=authenticateButton”);
//list of the users to be added in JIRA
String username = “test.user3,test.user4,test.user5,test.user6,test.user7”;
String[] list = null;
list = username.split(“,”);
for(int i=0; i<list.length; i++ )
String userName = list[i];
String fullName = userName.replace(“.”, ” “);“id=add_user”);
selenium.type(“name=username”, userName);
selenium.type(“name=fullname”, fullName);
selenium.type(“name=email”, userName+””);“name=sendEmail”);“id=create_submit”);
selenium.addSelection(“name=groupsToJoin”, “label=jira-group”);“name=join”);
selenium.waitForPageToLoad(“30000”);“link=Access more options”);“id=log_out”);
public void tearDown()
//Added . Will be called when the test will complete

For running this script you need to have the username and password of the user who has the administrator access over jira, else the script will fail. Here, we have taken the users list in an String array and then iterated the same using the for loop. However, you can use a code to take the users list from external source such as xml or Excel sheet, that will be really helpful.

Hope this will help you.


Nikhil Naoghare.

One thought on “Selenium Script to add users in JIRA.”

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.