Skip to main content
Transform your testing process with: Real Device Features, Company-wide Licences, & Test Observability
No Result Found

Organize Tests

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:

browserstack.yml
Copy icon Copy

Build Tag

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.

browserstack.yml
Copy icon Copy

Build Tag

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.

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.

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 page

MutableCapabilities capabilities = new MutableCapabilities();
HashMap<String, Object> browserstackOptions = new HashMap<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 page

var capabilities = {
	'bstack:options' : {
		"projectName" : "Marketing Website v2",
		"buildName" : "alpha_0.1.7",
		"sessionName" : "Home page must have a title",
		"buildTag" : "reg"
	}
}
// Testing the home page

Dictionary<string, object> browserstackOptions = new Dictionary<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"
	}
}

Build Tag

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 page

MutableCapabilities capabilities = new MutableCapabilities();
HashMap<String, Object> browserstackOptions = new HashMap<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 page

var capabilities = {
	'bstack:options' : {
		"projectName" : "Marketing Website v2",
		"buildName" : "alpha_0.1.7",
		"sessionName" : "Admin page access must be denied",
		"buildTag" : "sanity"
	}
}
// Testing the admin page

Dictionary<string, object> browserstackOptions = new Dictionary<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"
	}
}

Build Tag

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 page

DesiredCapabilities caps = new DesiredCapabilities();
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 page

var capabilities = {
 "project" : "Marketing Website v2",
 "build" : "alpha_0.1.7",
 "name" : "Home page must have a title",
 "build_tag" : "reg"
}
// Testing the home page

DesiredCapabilities capability = new DesiredCapabilities();
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"

Build Tag

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 page

DesiredCapabilities caps = new DesiredCapabilities();
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 page

var capabilities = {
 "project" : "Marketing Website v2",
 "build" : "alpha_0.1.7",
 "name" : "Admin page access must be denied",
 "build_tag" : "sanity"
}

// Testing the admin page

DesiredCapabilities capability = new DesiredCapabilities();
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"

Build Tag

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.

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

Is this page helping you?

Yes
No

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!

Talk to an Expert
Download Copy Check Circle