Skip to main content

Comprehensive Troubleshooting Guide for SmartUI

This comprehensive troubleshooting guide covers common issues you may encounter when using SmartUI for visual regression testing. Each issue includes symptoms, possible causes, and step-by-step solutions.

Quick Diagnostic Checklist

Before diving into specific issues, run through this quick checklist:

  • Project token is set correctly (PROJECT_TOKEN environment variable)
  • SmartUI CLI is installed and up-to-date (npx smartui --version)
  • Configuration file (.smartui.json) exists and is valid JSON
  • Network connectivity to LambdaTest servers
  • Project exists in SmartUI dashboard
  • Credentials (for Hooks) are set correctly (LT_USERNAME, LT_ACCESS_KEY)
  • Project name matches exactly (case-sensitive)

Troubleshooting by Category

Issue: Screenshots Not Appearing in Dashboard

Symptoms:

  • Tests run successfully but no screenshots appear in SmartUI dashboard
  • Build appears empty in dashboard
  • No error messages in logs

Possible Causes:

  • Project token not set or incorrect
  • Project name mismatch
  • Network connectivity issues
  • CLI not installed or outdated
  • Configuration file issues

Solutions:

  1. Verify Project Token:

    echo $PROJECT_TOKEN

    If empty, set it:

    export PROJECT_TOKEN="123456#1234abcd-****-****-****-************"
  2. Check Project Name: Verify project name in dashboard matches exactly (case-sensitive)

  3. Verify SmartUI CLI Installation:

    npx smartui --version

    If outdated, update:

    npm install -g @lambdatest/smartui-cli@latest
  4. Check Network Connectivity:

    curl -I https://smartui.lambdatest.com
  5. Review Test Execution Logs: Look for error messages or warnings in test output

Related Documentation: Project Settings, Running Your First Project


Issue: "Project Not Found" Error

Symptoms:

  • Error message: "Project not found" or "Invalid project token"
  • Tests fail to start
  • Authentication errors

Possible Causes:

  • Incorrect project token
  • Project deleted or renamed
  • Token from wrong project
  • Extra spaces or quotes in token
  • Token format incorrect

Solutions:

  1. Verify Project Exists:

  2. Copy Token Directly:

    • Go to Project Settings in dashboard
    • Copy project token directly (don't type manually)
    • Ensure token includes project ID prefix (e.g., 123456#...)
  3. Check Token Format:

    • Token should be in format: PROJECT_ID#TOKEN_VALUE
    • No extra spaces before or after
    • No quotes needed when setting environment variable
  4. Verify Token Scope:

    • Ensure token is from the correct project
    • Check if project was moved or renamed

Related Documentation: Project Settings


Issue: Credentials Not Working (Hooks)

Symptoms:

  • Tests fail with authentication errors
  • "Invalid credentials" message
  • Connection refused errors

Possible Causes:

  • LT_USERNAME or LT_ACCESS_KEY not set
  • Incorrect credentials
  • Credentials from wrong account
  • Environment variables not exported

Solutions:

  1. Verify Credentials Are Set:

    echo $LT_USERNAME
    echo $LT_ACCESS_KEY
  2. Get Correct Credentials:

  3. Set Credentials Correctly:

    export LT_USERNAME="your_username"
    export LT_ACCESS_KEY="your_access_key"

Related Documentation: Selenium Visual Regression, Playwright Visual Regression


Issue: CLI Installation and Version Management

Symptoms:

  • "command not found: smartui" error
  • CLI commands not working
  • Using outdated CLI version
  • Inconsistent behavior between terminals

Possible Causes:

  • CLI not installed globally
  • CLI installed locally but not accessible
  • Using outdated version
  • Multiple versions installed
  • PATH not configured correctly

Solutions:

  1. Understanding Global vs Local Installation:

    Global Installation (-g flag):

    • Installs CLI system-wide, accessible from any terminal
    • Command available as smartui directly
    • Requires administrator/sudo privileges
    • Best for: Single user, consistent environment
   npm install -g @lambdatest/smartui-cli

Local Installation (without -g):

  • Installs CLI in project's node_modules
  • Access via npx smartui or ./node_modules/.bin/smartui
  • No admin privileges needed
  • Best for: Project-specific versions, CI/CD pipelines
   npm install @lambdatest/smartui-cli
npx smartui --version
  1. Installing Latest Versions:

    SmartUI CLI:

    # Global installation (latest)
    npm install -g @lambdatest/smartui-cli@latest

    # Local installation (latest)
    npm install @lambdatest/smartui-cli@latest

    # Using npx (always uses latest)
    npx @lambdatest/smartui-cli@latest --version

    SmartUI Storybook CLI:

    # Global installation (latest)
    npm install -g @lambdatest/smartui-storybook@latest

    # Local installation (latest)
    npm install @lambdatest/smartui-storybook@latest

    # Using npx (always uses latest)
    npx @lambdatest/smartui-storybook@latest --version
  2. Checking Current Version:

    # If installed globally
    smartui --version

    # If installed locally or using npx
    npx smartui --version
  3. Updating to Latest Version:

    # Global update
    npm update -g @lambdatest/smartui-cli

    # Local update
    npm update @lambdatest/smartui-cli

    # Force reinstall latest
    npm install -g @lambdatest/smartui-cli@latest --force
  4. Resolving "Command Not Found":

    If installed globally:

    • Verify npm global bin is in PATH:
      echo $PATH | grep -i node
      npm config get prefix
    • Add to PATH if missing:
      # macOS/Linux - Add to ~/.bashrc or ~/.zshrc
      export PATH="$PATH:$(npm config get prefix)/bin"

    If installed locally:

    • Always use npx prefix:
      npx smartui --version
      npx smartui exec -- <command>
    • Or use direct path:
      ./node_modules/.bin/smartui --version
  5. Best Practices:

    • For Development: Use local installation with npx for project-specific versions
    • For CI/CD: Use npx @lambdatest/smartui-cli@latest to ensure latest version
    • For Global Use: Install globally with -g flag for convenience
    • Version Pinning: Use specific versions in package.json for reproducible builds

Related Documentation: CLI Complete Reference, Running Your First Project


Getting Additional Help

If you encounter issues not covered in this guide:

  1. Check Related Documentation:

  2. Search Existing Issues:

  3. Contact Support:

  4. Provide Diagnostic Information:

    • CLI version: npx smartui --version
    • Configuration file (redact sensitive data)
    • Error messages and logs
    • Steps to reproduce

Additional Resources

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

Book Demo

Help and Support

Related Articles