Skip to main content

Organize Tests

Name your tests and group your builds using build and project capability 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 and accessed on the Builds Dashboard.

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.
tags Add custom tags to your session / test case using tags capability An array.
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.
Maximum of 5 tags can be added to a session. The individual tag length can be set up to 50 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.
buildTags Add custom tags to your build using buildTags capability An array.
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.
Maximum of 5 tags can be added to a build. The individual build tag length can be set up to 50 characters.
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 buildTags capability allows you to filter your builds by the tag on the Builds 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("buildTags", new String[]{"regression", "alpha_release"});

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",
		"buildTags" : ["regression", "alpha_release"]
	}
}
// 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("buildTags", new string[] {"regression", "alpha_release"});

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",
		"buildTags" : ["regression", "alpha_release"]
	)
)
# Testing the home page

desired_cap = {
	'bstack:options' : {
		"projectName" : "Marketing Website v2",
		"buildName" : "alpha_0.1.7",
		"sessionName" : "Home page must have a title",
		"buildTags" : ["regression", "alpha_release"]
	},
}
# Testing the home page

capabilities = {
	'bstack:options' => {
		"projectName" => "Marketing Website v2",
		"buildName" => "alpha_0.1.7",
		"sessionName" => "Home page must have a title",
		"buildTags" : ["regression", "alpha_release"]
	}
}

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.

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