Praman — Agent-First SAP UI5 Test Automation Plugin - v1.2.0
    Preparing search index...

    Class ControlError

    Error subclass for UI5 control interaction failures.

    Self-healing fields: lastKnownSelector, availableControls, suggestedSelector — enable AI agents to suggest corrected selectors

    Not found — control ID or selector matches no controls in the UI5 view

    Not visible — control exists but is hidden or not in the visible DOM

    Not interactable — control is visible but disabled or read-only

    Requires active UI5 page with rendered controls

    const error = new ControlError({
    message: 'Button not found',
    attempted: 'Find button with ID: submitBtn',
    suggestedSelector: { id: 'btn1' },
    });

    Hierarchy (View Summary)

    Index

    Constructors

    • Creates a new ControlError instance.

      Parameters

      • options: ControlErrorOptions

        Control error construction options including self-healing selector fields.

      Returns ControlError

      import { ControlError } from '#core/errors/control-error.js';

      const error = new ControlError({
      message: 'Control not found: submitBtn',
      attempted: 'Find control with ID: submitBtn',
      lastKnownSelector: { id: 'oldSubmitBtn' },
      availableControls: ['btn1', 'btn2'],
      suggestedSelector: { id: 'btn1' },
      });

    Properties

    attempted: string
    availableControls: readonly string[]
    code: ErrorCode
    details: Readonly<Record<string, unknown>>
    lastKnownSelector: UI5Selector | undefined
    retryable: boolean
    severity: "error" | "info" | "warning"
    suggestedSelector: UI5Selector | undefined
    suggestions: readonly string[]
    timestamp: string

    Methods

    • Returns structured context for AI agents with control self-healing fields.

      Returns AIErrorContext & {
          availableControls: readonly string[];
          lastKnownSelector: UI5Selector | undefined;
          suggestedSelector: UI5Selector | undefined;
      }

      Base AI context plus lastKnownSelector, availableControls, and suggestedSelector fields to enable AI-driven selector correction.

      const context = error.toAIContext();
      // context.lastKnownSelector — the selector that previously worked
      // context.availableControls — controls currently in the view
      // context.suggestedSelector — best-match selector suggestion
    • Serializes the error to a JSON-safe object with control interaction fields.

      Returns SerializedPramanError & {
          availableControls: readonly string[];
          lastKnownSelector: UI5Selector | undefined;
          suggestedSelector: UI5Selector | undefined;
      }

      Base fields plus lastKnownSelector, availableControls, and suggestedSelector.

      const json = error.toJSON();
      // json.lastKnownSelector === { id: 'oldSubmitBtn' }
      // json.availableControls === ['btn1', 'btn2']
      // json.suggestedSelector === { id: 'btn1' }
    • Formats the error for human-readable console output.

      Returns string

      Multi-line formatted string with all diagnostic sections.

      console.error(error.toUserMessage());