Skip to main content

Group and Filter Your Test Builds Using Build Tags


With TestMu AI, you can group your test builds with Build tags. This document shows how to create Build tags and use them to group or filter your test builds on the TestMu AI Automation Dashboard.

How to Create Build Tags


Add a buildTags capability with a String array to your desired capabilities.

While writing your automation tests, add another capability when you create the Desired Capabilities via code. Follow the below steps:

  • Create an array of Strings that contains your Build tags, each separated by a comma.

    // For example, when you have only 1 tag
    String[] buildTagList = {"Build Tag"};

    // For example, when you have multiple tags
    String[] buildTagList = {"Tag 1", "Tag 2", "Tag 3", ...};
  • Now add this Build tag array in your Desired Capabilities instance: For example: While creating a sample Desired Capabilities instance in Java, the code will be:

    // Creating the Build Tags
    String[] buildTagList = {"Tag1", "Tag2", "Tag3", "BuildTagRishabh"};

    DesiredCapabilities caps = new DesiredCapabilities();
    caps.setCapability("browser", "Safari");
    caps.setCapability("version", "13");
    caps.setCapability("platform", "macos Catalina");
    caps.setCapability("build", "Build Tags Demo");
    caps.setCapability("name", "Sample Test");

    // To create custom tags
    caps.setCapability("buildTags", buildTagList);

    System.out.println("Desired Caps: " + caps);
    driver = new RemoteWebDriver(new URL("https://" + username + ":" + authkey + hub), caps);

You have successfully created the Build tags. Run your test and navigate to TestMu AI Automation Dashboard to see the tags in that build:

Group/filter

Guidelines for Creating Build Tags


Follow these limits when creating build tags to avoid unexpected behavior.

While creating Build Tags, follow the below guidelines:

  • Add a maximum of 5 custom tags to a build.
  • You can update the existing build by specifying different tags.
  • If you change a tag name or number of tags, no new build is created. The existing build is updated with the new tag to avoid unnecessary build creation.

How to Filter Tests Using Build Tags


Select one or more build tags in the filter toolbar to narrow down your test builds.

To group or filter the tests on your automation dashboard with Build tags:

Navigate to TestMu AI Automation Dashboard, and you can see a filter by name Build Tags on the right corner of the filter toolbar.

Group/filter

Select the Build tag by which you want to filter your test. For example, if we choose Tag1, only the test builds with the tag "Tag1" appear:

group/filter

You can choose multiple Build tags to filter your tests, as shown in the image below:

group/filter

You have successfully created a Build tag and grouped and filtered your tests based on these Build tags. If you have questions, share them with us through our 24/7 chat support or by mailing us at support@testmuai.com.

Test across 3000+ combinations of browsers, real devices & OS.

Book Demo

Help and Support

Related Articles