How to configure and run Selenium TestNG in Bamboo? I need a savior please.

I have selenium TestNG test written in java and using STS IDE. I use testNG.xml file to run it as testNG Suite. I use Bitbucket to store all the repositories. Now I want to run the Selenium TestNG test using Bamboo. I have already connected Bamboo to Bitbucket to use the repositories. But I can't figure out how to configure the testNG.xml file, java file, and the jar to Bamboo.

Does any one have any ideas of how to go about it. I have searched from the net for quite sometime, but I haven't come across any good tutorial or guide of how to go about it. 

Here are the files I was using in STS IDE:


  1. selenium-java-2.44.0.jar
  2. selenium-java-2.44.0-srcs.jar





<!DOCTYPE suite SYSTEM "">
<suite name="JobGo Suite">

<test name="FirefoxTest">
      <parameter name="browser" value="firefox" />
           <class name="com.mnn.MeTab"/>



package com.mnn;

import java.util.Properties;
import java.util.concurrent.TimeUnit;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.interactions.internal.Coordinates;
import org.openqa.selenium.internal.Locatable;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Parameters;
import org.testng.annotations.Test;

public class MeTab{
    private WebDriver driver;
    private String propertyFileName = "";
    private InputStream inputStream = MeTab.class.getClassLoader().getResourceAsStream(propertyFileName);
    private Properties prop = new Properties();

    * Opens the browser and navigate to the Landing Page
   public void beforeTest(String browser) throws IOException{

       driver = new FirefoxDriver();
    }else if(browser.equalsIgnoreCase("chrome")){
       driver = new ChromeDriver();
    }else if(browser.equalsIgnoreCase("ie")){
       driver = new InternetExplorerDriver();
       throw new RuntimeException("Browser type unsupported");

     driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);


    if( inputStream == null ){
        throw new FileNotFoundException("property file " + propertyFileName +
                " not found in the classpath");

    // navigate to jobgo web site

   // Maximize the browser Window

} // end of method beforeTest

* Method tests the landing page
@Test(priority = 0)
public void testLogin() throws Exception{
//time that elapses as the browser as the browser waits before executing
WebDriverWait wait = new WebDriverWait(driver, 120);

// Text has to be visible before another process is executed

// Click on Login
WebElement muwl = driver.findElement(By.className("Model_User_Widget_Login"));

// From the Login pop up, use the Sign In tab to login known credentials to the application
WebElement username = driver.findElement(By.className("login_form"));

// From the Login pop up, use the Sign In tab to login known credentials to the application
WebElement passwd = driver.findElement(By.className("login_form"));

// Check if 'Remember me' checkbox is not checked then check it
WebElement notChkbox = driver.findElement(By.className("chkbox"));


// If 'Remember me' checkbox is checked then uncheck it
WebElement chkbox = driver.findElement(By.className("chkbox"));


// Click on 'Sign in' button
WebElement signIn = driver.findElement(By.className("login_form"));

// Text has to be visible before another process is executed

* Closes the browser
public void quitDriver() throws Exception{
} // end of method quitDriver


Please any help is welcome. 

Cheers, Nelson

5 answers

0 vote

Hello Nelson,

To execute your tests in Bamboo you should use some executable build tool. Bamboo supports Ant, Maven, Command line, Grails.

Example of Maven configuration for TestNG tests:

Hello Alexey,

Thank you so much for the quick reply. I have made the modifications in code using Maven which executes when I use Eclipse IDE.  My biggest problem is with bamboo, I don't have a cue what to put in Executable and Environment variable fields as shown below. 

In the Executable field I have tried to link it up with the JARS from my local machine, but nothing happens. 

image2014-11-6 21:43:25.png


The repository attached to Bamboo from Bitbucket contains mnn_maven folder (master branch). Inside it, it has the pom.xml and src/com/mnn/

Please guide me from here as the configuration seems to be my biggest issue.










0 vote

Hello Nelson,

I created sample repository with Maven project and WebDriver test:

Please see instructions at Readme section. It looks like you configured everything except Maven capability. please follow link in readme to receive more instructions how to setup it. It's pretty easy, you just need to define path to Maven home folder in your environment.

In case pom.xml is not in the root of your repository you need to specify work folder for Maven task

Hope it helps



Hi Alexey,

Thank you so much for the help. At last it has worked out. 



The simplest and most scalable way is to used Selenium IDE and this add-on in Bamboo. With one build plan you can target all major browsers from one build plan. 

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published May 18, 2017 in Bamboo

FAQ: How to Upgrade Bamboo Server

Bamboo 5.9 will no longer be supported after June 12, 2017. What does this mean? As part of our End of Life policy, Atlassian supports major versions for two years after the first major iteratio...

1,821 views 0 6
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you