How To Create Custom Tags While Performing Automation On LambdaTest Selenium Grid?

How To Create Custom Tags While Performing Automation On LambdaTest Selenium Grid?

Hello Devan,

You can create a custom tag using a simple step. While writing your Selenium automation tests, when you create the Desired Capabilities via code, just add the below lines of code.

Create a String array that contains the names of your custom tags, separated by a comma.

    // In case for just 1 tag, just add 1 element in the array
        String[] customTags = {"Custom Tag"};

        // In case for multiple tags, add them in the array separated by comma
        String[] customTags = {"Tag 1", "Tag 2", "Tag 3", ...};

Now you just need to add this custom tag in your Desired Capabilities instance, as shown below:

DesiredCapabilities caps = new DesiredCapabilities();

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