Name your tests and group your builds by build names and project for better reporting.
You can organize your automated test sessions by using various capabilities on BrowserStack. These capabilities define how your test sessions are grouped together and accessed on the Automate dashboard.
If you are using BrowserStack SDK, you can set the following capabilities in the browserstack.yml file:
Capability
Description
Expected values
sessionName
Name for your session / test case
A string. Only letters (A-Z, a-z), digits (0-9), periods (.), colons (:), hyphens (-), square brackets ([]), forward slashes (/), spaces ( ), asperands (@), ampersands (&), single quotes (‘), and underscores (_) are allowed. Any other characters are ignored. The session name length can be set up to 255 characters.
buildName
Build version / number
A string. Only letters (A-Z, a-z), digits (0-9), periods (.), colons (:), hyphens (-), square brackets ([]), forward slashes (/), asperands (@), ampersands (&), single quotes (‘), and underscores (_) are allowed. Any other characters are ignored. The build number length can be set up to 255 characters.
buildTag
Add a custom tag to your build using buildTag capability or REST API
A string. Only letters (A-Z, a-z), digits (0-9), periods (.), colons (:), hyphens (-), square brackets ([]), forward slashes (/), asperands (@), ampersands (&), single quotes (‘), and underscores (_) are allowed. Any other characters are ignored. The build tag length can be set up to 255 characters.
buildIdentifier
A unique number for your build.
A dynamic build identifier that appends to the build name and generates a unique name on the BrowserStack dashboard ${BUILD_NUMBER} ${DATE_TIME}
projectName
Name of your project
A string. Only letters (A-Z, a-z), digits (0-9), periods (.), colons (:), hyphens (-), square brackets ([]), forward slashes (/), asperands (@), ampersands (&), single quotes (‘), and underscores (_) are allowed. Any other characters are ignored. The name length can be set up to 255 characters. The project name length can be set up to 255 characters.
Adding the buildTag allows you to filter your builds by the tag on the Automate Dashboard.
For example, if you are working on your new marketing website, and want to run your test suite for the Alpha 0.1.7 build, you can set the following capabilities in the browserstack.yml file:
```yml
// Testing the home page
browserstackLocal: true
buildName: alpha_0.1.7
buildIdentifier: '${BUILD_NUMBER}'
projectName: BrowserStack Sample
buildTag: sanity
sessionName: Home page must have a title
```
// Testing the home page
browserstackLocal:truebuildName: alpha_0.1.7
buildIdentifier:'${BUILD_NUMBER}'projectName: BrowserStack Sample
buildTag: sanity
sessionName: Home page must have a title
When you run the next test, simply change the build name, and it will be grouped into the same build and project. Similarly, you can update the build tag - the most recent build tag will replace any previous tags you may have provided and add a new tag if one did not previously exist.
```yml
// Testing the admin page
browserstackLocal: true
buildName: alpha_0.1.8
buildIdentifier: '${BUILD_NUMBER}'
projectName: BrowserStack Sample
buildTag: sanity
sessionName: Home page must have a title
```
// Testing the admin page
browserstackLocal:truebuildName: alpha_0.1.8
buildIdentifier:'${BUILD_NUMBER}'projectName: BrowserStack Sample
buildTag: sanity
sessionName: Home page must have a title
You can use the sessionName capability to give your session a name (usually describing the test case) and buildName capability (usually the same as the build ID that’s on your CI/CD platform) so that it is easy for you to debug later.
The sessionName capability can be overridden using the following in your browserstack.yml file: testContextOptions: skipSessionName: true
You can use either Selenium 4 or Selenium Legacy JSON to organize your tests.
BrowserStack SDK is a plug-n-play solution that takes care of all the integration steps for you. Using the BrowserStack SDK is the recommended integration method for your project. To know more, visit the SDK core concepts page.
A string. Only letters (A-Z, a-z), digits (0-9), periods (.), colons (:), hyphens (-), square brackets ([]), forward slashes (/), spaces ( ), asperands (@), ampersands (&), single quotes (‘), and underscores (_) are allowed. Any other characters are ignored. The session name length can be set up to 255 characters.
buildName
Build version / number
A string. Only letters (A-Z, a-z), digits (0-9), periods (.), colons (:), hyphens (-), square brackets ([]), forward slashes (/), asperands (@), ampersands (&), single quotes (‘), and underscores (_) are allowed. Any other characters are ignored. The build number length can be set up to 255 characters.
buildTag
Add a custom tag to your build using buildTag capability or REST API
A string. Only letters (A-Z, a-z), digits (0-9), periods (.), colons (:), hyphens (-), square brackets ([]), forward slashes (/), asperands (@), ampersands (&), single quotes (‘), and underscores (_) are allowed. Any other characters are ignored. The build tag length can be set up to 255 characters.
buildIdentifier
A unique number for your build.
A dynamic build identifier that appends to the build name and generates a unique name on the BrowserStack dashboard ${BUILD_NUMBER} ${DATE_TIME}
projectName
Name of your project
A string. Only letters (A-Z, a-z), digits (0-9), periods (.), colons (:), hyphens (-), square brackets ([]), forward slashes (/), asperands (@), ampersands (&), single quotes (‘), and underscores (_) are allowed. Any other characters are ignored. The name length can be set up to 255 characters. The project name length can be set up to 255 characters.
Ensure that you set up build name before you add a tag, otherwise the build tag will be ignored.
Learn why you should be using build names to get the most out of BrowserStack Automate.
Adding the build_tag allows you to filter your builds by the tag on the Automate Dashboard.
For example, if you are working on your new marketing website, and want to run your test suite for the Alpha 0.1.7 build, you can pass the following capabilities:
// Testing the home pageMutableCapabilities capabilities =newMutableCapabilities();HashMap<String,Object> browserstackOptions =newHashMap<String,Object>();
browserstackOptions.put("projectName","Marketing Website v2");
browserstackOptions.put("buildName","alpha_0.1.7");
browserstackOptions.put("sessionName","Home page must have a title");
browserstackOptions.put("buildTag","reg");
capabilities.setCapability("bstack:options", browserstackOptions);
// Testing the home pagevar capabilities ={'bstack:options':{"projectName":"Marketing Website v2","buildName":"alpha_0.1.7","sessionName":"Home page must have a title","buildTag":"reg"}}
// Testing the home pageDictionary<string,object> browserstackOptions =newDictionary<string,object>();
browserstackOptions.Add("projectName","Marketing Website v2");
browserstackOptions.Add("buildName","alpha_0.1.7");
browserstackOptions.Add("sessionName","Home page must have a title");
browserstackOptions.Add("buildTag","reg");
capabilities.AddAdditionalOption("bstack:options", browserstackOptions);
# Testing the home page$caps=array('bstack:options'=>array("projectName"=>"Marketing Website v2","buildName"=>"alpha_0.1.7","sessionName"=>"Home page must have a title","buildTag"=>"reg"))
# Testing the home page
desired_cap ={'bstack:options':{"projectName":"Marketing Website v2","buildName":"alpha_0.1.7","sessionName":"Home page must have a title","buildTag":"reg"},}
# Testing the home page
capabilities ={'bstack:options'=>{"projectName"=>"Marketing Website v2","buildName"=>"alpha_0.1.7","sessionName"=>"Home page must have a title","buildTag"=>"reg"}}
When you run the next test, simply change the build name, and it will be grouped into the same build and project. Similarly, you can update the build tag - the most recent build tag will replace any previous tags you may have provided and add a new tag if one did not previously exist.
// Testing the admin pageMutableCapabilities capabilities =newMutableCapabilities();HashMap<String,Object> browserstackOptions =newHashMap<String,Object>();
browserstackOptions.put("projectName","Marketing Website v2");
browserstackOptions.put("buildName","alpha_0.1.7");
browserstackOptions.put("sessionName","Admin page access must be denied");
browserstackOptions.put("buildTag","sanity");
capabilities.setCapability("bstack:options", browserstackOptions);
// Testing the admin pagevar capabilities ={'bstack:options':{"projectName":"Marketing Website v2","buildName":"alpha_0.1.7","sessionName":"Admin page access must be denied","buildTag":"sanity"}}
// Testing the admin pageDictionary<string,object> browserstackOptions =newDictionary<string,object>();
browserstackOptions.Add("projectName","Marketing Website v2");
browserstackOptions.Add("buildName","alpha_0.1.7");
browserstackOptions.Add("sessionName","Admin page access must be denied");
browserstackOptions.Add("buildTag","sanity");
capabilities.AddAdditionalOption("bstack:options", browserstackOptions);
# Testing the admin page$caps=array('bstack:options'=>array("projectName"=>"Marketing Website v2","buildName"=>"alpha_0.1.7","sessionName"=>"Admin page access must be denied","buildTag"=>"sanity"))
# Testing the admin page
desired_cap ={'bstack:options':{"projectName":"Marketing Website v2","buildName":"alpha_0.1.7","sessionName":"Admin page access must be denied","buildTag":"sanity"}}
# Testing the admin page
capabilities ={'bstack:options'=>{"projectName"=>"Marketing Website v2","buildName"=>"alpha_0.1.7","sessionName"=>"Admin page access must be denied","buildTag"=>"sanity"}}
You can use the sessionName capability to give your session a name (usually describing the test case) and buildName capability (usually the same as the build ID that’s on your CI/CD platform) so that it is easy for you to debug later.
The sessionName capability can be overridden using the following in your browserstack.yml file: testContextOptions: skipSessionName: true
Remember to update the build version / number the next time you run the test again. If you are running your tests on a different project, remember to update the project name too.
Capability
Description
Expected values
name
Name for your session / test case
A string. Only letters (A-Z, a-z), digits (0-9), periods (.), colons (:), hyphens (-), square brackets ([]), forward slashes (/), spaces ( ), asperands (@), ampersands (&), single quotes (‘), and underscores (_) are allowed. Any other characters are ignored. The session name length can be set up to 255 characters.
build
Build version / number
A string. Only letters (A-Z, a-z), digits (0-9), periods (.), colons (:), hyphens (-), square brackets ([]), forward slashes (/), asperands (@), ampersands (&), single quotes (‘), and underscores (_) are allowed. Any other characters are ignored. The build number length can be set up to 255 characters.
build_tag
Add a custom tag to your build using build_tag capability or REST API
A string. Only letters (A-Z, a-z), digits (0-9), periods (.), colons (:), hyphens (-), square brackets ([]), forward slashes (/), asperands (@), ampersands (&), single quotes (‘), and underscores (_) are allowed. Any other characters are ignored. The build tag length can be set up to 255 characters.
project
Name of your project
A string. Only letters (A-Z, a-z), digits (0-9), periods (.), colons (:), hyphens (-), square brackets ([]), forward slashes (/), asperands (@), ampersands (&), single quotes (‘), and underscores (_) are allowed. Any other characters are ignored. The name length can be set up to 255 characters. The project name length can be set up to 255 characters.
Ensure that you set up build name before you add a tag, otherwise the build tag will be ignored.
Learn why you should be using build names to get the most out of BrowserStack Automate.
Adding the build_tag allows you to filter your builds by the tag on the Automate Dashboard.
For example, if you are working on your new marketing website, and want to run your test suite for the Alpha 0.1.7 build, you can pass the following capabilities:
// Testing the home pageDesiredCapabilities caps =newDesiredCapabilities();
caps.setCapability("project","Marketing Website v2");
caps.setCapability("build","alpha_0.1.7");
caps.setCapability("name","Home page must have a title");
caps.setCapability("build_tag","reg");
// Testing the home pagevar capabilities ={"project":"Marketing Website v2","build":"alpha_0.1.7","name":"Home page must have a title","build_tag":"reg"}
// Testing the home pageDesiredCapabilities capability =newDesiredCapabilities();
capability.AddAdditionalCapability("project","Marketing Website v2",true);
capability.AddAdditionalCapability("build","alpha_0.1.7",true);
capability.AddAdditionalCapability("name","Home page must have a title",true);
capability.AddAdditionalCapability("build_tag","reg",true);
# Testing the home page$caps=array("project"=>"Marketing Website v2","build"=>"alpha_0.1.7","name"=>"Home page must have a title","build_tag"=>"reg");
# Testing the home page
desired_cap ={"project":"Marketing Website v2","build":"alpha_0.1.7","name":"Home page must have a title","build_tag":"reg"}
# Testing the home page
caps =Selenium::WebDriver::Remote::Capabilities.new
caps["project"]="Marketing Website v2"
caps["build"]="alpha_0.1.7"
caps["name"]="Home page must have a title"
caps["build_tag"]="reg"
When you run the next test, simply change the build name, and it will be grouped into the same build and project. Similarly, you can update the build tag - the most recent build tag will replace any previous tags you may have provided and add a new tag if one did not previously exist.
// Testing the admin pageDesiredCapabilities caps =newDesiredCapabilities();
caps.setCapability("project","Marketing Website v2");
caps.setCapability("build","alpha_0.1.7");
caps.setCapability("name","Admin page access must be denied");
caps.setCapability("build_tag","sanity");
// Testing the admin pagevar capabilities ={"project":"Marketing Website v2","build":"alpha_0.1.7","name":"Admin page access must be denied","build_tag":"sanity"}
// Testing the admin pageDesiredCapabilities capability =newDesiredCapabilities();
capability.AddAdditionalCapability("project","Marketing Website v2",true);
capability.AddAdditionalCapability("build","alpha_0.1.7",true);
capability.AddAdditionalCapability("name","Admin page access must be denied",true);
capability.AddAdditionalCapability("build_tag","sanity",true);
# Testing the admin page$caps=array("project"=>"Marketing Website v2","build"=>"alpha_0.1.7","name"=>"Admin page access must be denied","build_tag"=>"sanity");
# Testing the admin page
desired_cap ={"project":"Marketing Website v2","build":"alpha_0.1.7","name":"Admin page access must be denied","build_tag":"sanity"}
# Testing the admin page
caps =Selenium::WebDriver::Remote::Capabilities.new
caps["project"]="Marketing Website v2"
caps["build"]="alpha_0.1.7"
caps["name"]="Admin page access must be denied"
caps["build_tag"]="sanity"
You can use the name capability to give your session a name (usually describing the test case) and build capability (usually the same as the build ID that’s on your CI/CD platform) so that it is easy for you to debug later.
Remember to update the build version / number the next time you run the test again. If you are running your tests on a different project, remember to update the project name too.
Ensure that you set up build name before you add a tag, otherwise the build tag will be ignored.
Learn why you should be using build names to get the most out of BrowserStack Automate.
Did this page help you?
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