Search by

Bamboo CI

Integrate your Appium test suite with Bamboo and BrowserStack device cloud for native and hybrid apps, using our Bamboo plugin.

Introduction

Bamboo is a continuous integration server that allows you to build, test and deploy your web and mobile app applications. Our Bamboo plugin enables the integration between your Appium tests, Bamboo and the BrowserStack real device cloud.

Use the BrowserStack Bamboo plugin to:

  • Configure your BrowserStack credentials for your Bamboo jobs.
  • Create a build step to upload your app build to the BrowserStack server.
  • Set up and tear down the BrowserStack Local binary for testing mobile apps against the internal, private or development servers.

Prerequisites

Before installing the plugin please make sure that you have the necessary privileges to administer your Bamboo installation. In addition, ensure that there are no active build jobs running on Bamboo when installing the plugin. You will also need the following:

  • An existing Bamboo CI server v5.13.2 or above
  • A BrowserStack account

Installing the Bamboo plugin

Before installing the plugin please make sure that you have the necessary privileges to administer your Bamboo installation. We recommend that you do this when there are no active build jobs running on Bamboo.

  1. Log into your Bamboo instance as an admin.
  2. Click the admin dropdown (Settings icon on the top menu) and choose Add-ons.
  3. The Manage add-ons screen will load.
  4. Click Find new add-ons, located under the ADD-ONS section on the left-hand side of the page.
  5. Locate BrowserStack Plugin for Bamboo via search.
  6. Results include add-on versions compatible with your Bamboo instance.
  7. Click Install to download and install your add-on.
  8. You’re all set!

Configuring your BrowserStack credentials

Once you’ve installed the plugin, you will need to configure your BrowserStack credentials to complete the integration:

  1. Go to Settings > Overview > BrowserStack Configuration in the Bamboo administration control panel.
  2. Add your BrowserStack Username and Access Key
  3. Save your changes

credentials

Configuring BrowserStack local

BrowserStack Local Testing allows you to test your apps against the private, development, and internal servers. With the Local testing binary, you can create a secure, private connection between the BrowserStack Appium and your internal servers. The BrowserStack Bamboo plugin is responsible for:

  1. Downloading the BrowserStack local binary for every platform that the build job is running on.
  2. Setting up and tearing down the secure tunnel.
  3. The BrowserStack Bamboo plugin sets the following environment variables:
BROWSERSTACK_USERNAME
BROWSERSTACK_ACCESS_KEY
BROWSERSTACK_LOCAL
BROWSERSTACK_LOCAL_IDENTIFIER
BROWSERSTACK_APP_ID

Use these environment variables to set the DesiredCapabilities in your tests. For example:

String userName = System.getenv("BROWSERSTACK_USERNAME");
String accessKey = System.getenv("BROWSERSTACK_ACCESS_KEY");
String browserstackLocal = System.getenv("BROWSERSTACK_LOCAL");
String browserstackLocalIdentifier = System.getenv("BROWSERSTACK_LOCAL_IDENTIFIER");
String app = System.getenv("BROWSERSTACK_APP_ID");

public static void main(String args[]) throws MalformedURLException, InterruptedException {
    DesiredCapabilities caps = new DesiredCapabilities();
    caps.setCapability("device", "Samsung Galaxy S8");
    caps.setCapability("app", app);
    caps.setCapability("browserstack.local", browserstackLocal);
    caps.setCapability("browserstack.localIdentifier", browserstackLocalIdentifier);
}

driver = new AndroidDriver(new URL("https://"+userName+":"+accessKey+"@hub-cloud.browserstack.com/wd/hub"), caps);
userName = process.env.BROWSERSTACK_USERNAME
accessKey = process.env.BROWSERSTACK_ACCESS_KEY
browserstackLocal = process.env.BROWSERSTACK_LOCAL
browserstackLocalIdentifier = process.env.BROWSERSTACK_LOCAL_IDENTIFIER
app = process.env.BROWSERSTACK_APP_ID 

var capabilities = {
    "browserstack.user" : userName,
    "browserstack.key" : accessKey,
    "device" : "Samsung Galaxy S8",
    "app" : app
    "browserstack.local" : browserstackLocal,
    "browserstack.localIdentifier" : browserstackLocalIdentifier
}

driver = wd.promiseRemote("https://hub-cloud.browserstack.com/wd/hub");

driver
  .init(capabilities)
  //Write your code here
  .fin(function() { return driver.quit(); })
  .done();
userName = Environment.GetEnvironmentVariable("BROWSERSTACK_USERNAME");
accessKey = Environment.GetEnvironmentVariable("BROWSERSTACK_ACCESS_KEY");
browserstackLocal = Environment.GetEnvironmentVariable("BROWSERSTACK_LOCAL");
browserstackLocalIdentifier = Environment.GetEnvironmentVariable("BROWSERSTACK_LOCAL_IDENTIFIER");
app = Environment.GetEnvironmentVariable("BROWSERSTACK_APP_ID");

DesiredCapabilities caps = new DesiredCapabilities();
caps.SetCapability("browserstack.user", userName);
caps.SetCapability("browserstack.key", accessKey);
caps.SetCapability("app", app);
caps.setCapability("device", "Samsung Galaxy S8");
caps.SetCapability("browserstack.local", browserstackLocal);
caps.SetCapability("browserstack.localIdentifier", browserstackLocalIdentifier);

AndroidDriver driver = new AndroidDriver(new Uri("https://hub-cloud.browserstack.com/wd/hub"), caps);
$user_name = getenv("BROWSERSTACK_USERNAME");
$access_key = getenv("BROWSERSTACK_ACCESS_KEY");
$browserstack_local = getenv("BROWSERSTACK_LOCAL");
$browserstack_local_identifier = getenv("BROWSERSTACK_LOCAL_IDENTIFIER");
$app = getenv("BROWSERSTACK_APP_ID");


$capabilities = new DesiredCapabilities();
$capabilities->setCapability("device", "Samsung Galaxy S8");
$capabilities->setCapability("app", $app);
$capabilities->setCapability("browserstack.local", $browserstack_local);
$capabilities->setCapability("browserstack.localIdentifier", $browserstack_local_identifier);

$driver = RemoteWebDriver::create("https://"+user_name+":"+access_key+"@hub-cloud.browserstack.com/wd/hub", $capabilities);
user_name = os.getenv("BROWSERSTACK_USERNAME")
access_key = os.getenv("BROWSERSTACK_ACCESS_KEY")
browserstack_local = os.getenv("BROWSERSTACK_LOCAL")
browserstack_local_identifier = os.getenv("BROWSERSTACK_LOCAL_IDENTIFIER")
app = os.getenv("BROWSERSTACK_APP_ID")

desired_cap = {
 'device': 'Samsung Galaxy S8',
 'app': app,
 'browserstack.local': browserstack_local,
 'browserstack.localIdentifier': browserstack_local_identifier
}

driver = webdriver.Remote("https://"+user_name+":"+access_key+"@hub-cloud.browserstack.com/wd/hub", desired_cap)
user_name = ENV["BROWSERSTACK_USERNAME"]
access_key = ENV["BROWSERSTACK_ACCESS_KEY"]
browserstack_local = ENV["BROWSERSTACK_LOCAL"]
browserstack_local_identifier = ENV["BROWSERSTACK_LOCAL_IDENTIFIER"]
app = ENV["BROWSERSTACK_APP_ID"]

desired_caps = {
	'device': 'Samsung Galaxy S8',
    'app': app,
    'browserstack.local': browserstack_local,
    'browserstack.localIdentifier': browserstack_local_identifier
}


appium_driver = Appium::Driver.new({
    'caps' => desired_caps,
    'appium_lib' => {
        :server_url => "https://#{user_name}:#{access_key}@hub-cloud.browserstack.com/wd/hub"
    }}, true)

Note: If you are using BrowserStack Local, you must pass browserstack.local and browserstack.localIdentifier capabilities to test on your local development servers.

To enable BrowserStack Local follow these steps:

  1. Check Enable BrowserStack Local in the BrowserStack Configuration section. Note that in case you’re already using BrowserStack Local through our bindings, you don’t need to check this.
  2. Use Modifiers to set any additional configuration (Full list of options here )

config

Configure app upload step for individual job

You can use BrowserStack Plugin for Bamboo to upload your app builds to the BrowserStack servers for individual jobs. You can also configure your BrowserStack credentials and local settings at the job level. Any configuration passed at the job level will override the Global configuration set in the Administration section. To set a job configuration:

  1. Check Override Admin Config inside the Miscellaneous tab for the job

  2. You will now be able to enter your BrowserStack credentials

  3. Check Enable BrowserStack Local to test on your local development servers

    admin

  4. Check Enable App-Automate and provide the path to your app file in the App Path text box

    plan

You can now run your App Automate tests using the Bamboo plugin on the BrowserStack cloud.

Conclusion

By following the steps outlined in this guide, you should have a seamless integration between your existing automation in Bamboo, your Appium tests and the BrowserStack Real Device Cloud. This will help you leverage all the benefits of test automation and the scale and coverage offered by BrowserStack.