Integrate BrowserStack App Automate with Bamboo
Integrate your Appium test suite with Bamboo and BrowserStack device cloud for testing native and hybrid apps, using our Bamboo plugin.
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.
- Log into your Bamboo instance as an admin.
- Click the admin dropdown (Settings icon on the top menu) and choose Add-ons.
- The Manage add-ons screen will load.
- Click Find new add-ons, located under the ADD-ONS section on the left-hand side of the page.
- Locate BrowserStack Plugin for Bamboo via search.
- Results include add-on versions compatible with your Bamboo instance.
- Click Install to download and install your add-on.
- 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:
- Go to Settings > Overview > BrowserStack Configuration in the Bamboo administration control panel.
- Add your BrowserStack Username and Access Key
- Save your changes
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:
- Downloading the BrowserStack local binary for every platform that the build job is running on.
- Setting up and tearing down the secure tunnel.
- 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:
- 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.
- Use Modifiers to set any additional configuration (Full list of options available in documentation for local testing modifiers )
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:
-
Check Override Admin Config inside the Miscellaneous tab for the job
-
You will now be able to enter your BrowserStack credentials
-
Check Enable BrowserStack Local to test on your local development servers
-
Check Enable App-Automate and provide the path to your app file in the App Path text box
You can now run your App Automate tests using the Bamboo plugin on the BrowserStack cloud.
Generating and embedding test reports (for JUNit and TestNG only)
BrowserStack enables you to easily debug your Appium tests with features like Video recordings, Appium logs, and device logs. With our Bamboo plugin, you can view all the logs and reports generated by BrowserStack right inside Bamboo. At this point, embedding test reports only works with a select set of frameworks. Following are the prerequisites for generating and embedding test reports:
- Project must be a Java project.
- Project must be built with Maven and use either TestNG or JUnit for testing.
Add the following dependencies to your pom.xml
file:
Add the following repositories to your pom.xml file:
Add the following plugin to your pom.xml
file:
You must define the Maven properties jdk.source.version
and jdk.target.version
to match the Java versions of your project.
Create a new artifact named BSTACK_REPORTS
which stores all of the **/*.xml
files generated by your test suite.
Note: Ensure the Shared
checkbox is unchecked.
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.
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
Thank you for your valuable feedback!