AutoBE
    Preparing search index...

    Interface IElementAccessExpression

    Element access expression for dynamic property access and array indexing.

    Enables access to object properties using computed keys or array elements using indices. Useful for dynamic property access based on runtime values or when property names are not valid identifiers.

    Primary use cases in E2E testing:

    • Array element access from captured API response data (order.items[0])
    • Dynamic property access with string keys from API responses
    • Accessing properties with special characters from captured data
    • Computed property access based on test data

    AI function calling context: Use when property access requires computation or when accessing array elements by index in captured data.

    interface IElementAccessExpression {
        argumentExpression: IExpression;
        expression: IExpression;
        questionDot?: boolean;
        type: "elementAccessExpression";
    }
    Index

    Properties

    argumentExpression: IExpression

    Expression that evaluates to the property key or array index.

    For arrays: typically INumericLiteral for index access For objects: typically IStringLiteral for property key Can be any expression that evaluates to a valid key type

    Examples:

    • INumericLiteral(0) for first array element
    • IStringLiteral("id") for property access
    • IIdentifier("index") for variable-based access
    expression: IExpression

    The base expression being indexed/accessed.

    Can be any expression that evaluates to an object or array. Typically represents collections or objects from captured API responses with dynamic properties.

    Should reference previously captured data from API operations rather than direct API calls.

    questionDot?: boolean

    Whether to use optional chaining (?.[]) operator.

    True: Uses ?.[] for safe element access False: Uses [] for standard element access

    Use optional chaining when the base expression might be null/undefined or when the accessed element might not exist in the captured data.

    type: "elementAccessExpression"

    Type discriminator.