For AI agents and LLMs: a machine-readable index is available at llms.txt. A plain-Markdown version of any documentation page is available by appending .md to its URL.
Skip to main content

Set Project Tags from Code New

Tags help you find and group SmartUI projects, for example by team, product area or test suite. You can type them into Project Settings > Basic > Tags, and you can also declare them in your automation so every run keeps the project tagged without anyone opening the dashboard.

Tags set from code are ordinary project tags. They appear as chips on the project card, in the Tags filter on the Projects page and in Project Settings, exactly like tags added by hand.

SmartUI Project Settings Tags field listing tags added from a test run alongside one added in the dashboard

Where you can set tags

How you run SmartUIKeyValue
Selenium with SmartUI hooks (LT:Options)smartUI.tagsArray of strings
Playwright on the cloud grid (LT:Options)smartUITagsArray of strings
SmartUI CLI config file (smartui exec, smartui capture, smartui upload-pdf)tagsArray of strings

Tags always belong to the project. SmartUI does not store tags on builds or on individual screenshots.

Set tags in capabilities

Add smartUI.tags next to your other SmartUI capabilities.

Selenium: tag the SmartUI project from LT:Options
const capabilities = {
browserName: "chrome",
"LT:Options": {
user: process.env.LT_USERNAME,
accessKey: process.env.LT_ACCESS_KEY,
visual: true,
"smartUI.project": "checkout-web",
"smartUI.build": "nightly",
"smartUI.tags": ["regression", "checkout-flow"]
}
};

Set tags in the SmartUI CLI config file

Add a top-level tags array to the config file you pass with --config. The same key works for smartui exec, smartui capture and smartui upload-pdf. It requires SmartUI CLI 4.1.83 or later; earlier versions stop with must NOT have additional properties.

smartui.json
{
"web": {
"browsers": ["chrome"],
"viewports": [[1280]]
},
"tags": ["from-cli", "nightly"]
}
npx smartui exec --config smartui.json -- npm test

For PDF uploads, the config file must also contain a pdf block (it can be empty). A file with only tags is rejected with must have required property 'web'.

pdf-config.json
{
"pdf": {},
"tags": ["pdf-suite", "release-docs"]
}
npx smartui upload-pdf ./pdfs --config pdf-config.json --buildName "release-42"

Tags inside an array are never split, so ["team, web"] creates one tag named team, web.

How tags are applied

  • Tags are only ever added. A run never removes tags. Tags someone added in the dashboard stay in place when a run sends a different list.
  • Repeat runs change nothing. Sending a tag the project already has does not create a duplicate.
  • Matching ignores case. If the project already has regression, sending Regression keeps the stored spelling and adds nothing.
  • A deleted tag can come back. If someone removes a tag in the dashboard and a later run still sends it, the tag is added to the project again. Remove it from your code as well.
  • The project name tag stays. When automation creates a project, SmartUI also tags it with the project's own name. Your tags are added next to it.

Limits and errors

A tag list is applied in full or not at all. If any rule below is broken, no tags are added and the run fails.

RuleLimit
Tags per runAt most 50
Tags on a projectAt most 50 in total, counting the tags the project already has
Tag length1 to 50 characters, after leading and trailing spaces are removed
DuplicatesNot allowed in the same list, compared without case (Foo and foo count as the same tag)
TypeArray of strings

If a run would take the project past 50 tags, it fails with project tag limit reached: project has 49 tags and 2 more were requested; the limit is 50. Tags the project already has do not count as new. If the project is linked to Test Manager and Test Manager refuses the new tags, the run fails with Test Manager rejected the tags and no tags are added.

What you see when a list is refused:

WhereResult
Selenium or Playwright capabilitiesThe session is not created. The error names the rule, for example The number of smartUI.tags should not exceed 50, smartUI.tags entry is too long. Max length is 50 characters or invalid tags: tag "foo" is listed more than once. No project or build is created.
smartui exec or smartui captureType, length and exact duplicate problems stop the CLI before it contacts SmartUI, for example Invalid config; tags must be unique. A duplicate that differs only in case fails at build creation with invalid tags: tag "foo" is listed more than once. Both exit with code 1.
smartui upload-pdfConfig file problems stop the CLI with the same Invalid config; ... messages and exit code 1. A duplicate that differs only in case ends with invalid tags: tag "dup" is listed more than once and PDF upload failed, but exits with code 0, so check the output for PDF upload failed in CI.
note

When the CLI refuses a case-only duplicate, it has already resolved the project by then. If the project did not exist, it is created with no builds.

Find projects by tag

On the Projects page, open the Tags filter and search for a tag to list every project that carries it. Project cards show the first two tags and collapse the rest into +N more.

Terminal First Testing With Kane CLI

Natural language browser & mobile app tests right from terminal.

×
Schedule Your Personal Demo
Kane CLI terminal

Help and Support

Related Articles