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

    Function createEntity

    • Ai

      Creates a new entity via HTTP POST.

      Type Parameters

      • TData = unknown

      Parameters

      • page: ODataHttpPage

        Playwright Page with request API.

      • serviceUrl: string

        OData service root URL.

      • entitySet: string

        Name of the entity set.

      • data: unknown

        Entity data to create.

      • Optionaloptions: ODataHttpOptions

        HTTP options including required CSRF token.

      Returns Promise<ODataHttpResult<TData>>

      The created entity with HTTP status and optional ETag.

      ui5.odata.createEntity

      Create a new OData entity by sending a POST request to the service.

      On success, the entity is created and the response contains the created entity data with HTTP 201 status.

      Uses Playwright's request API to POST directly to the OData service. Requires a CSRF token obtained via fetchCSRFToken(). Supports both OData V2 and V4 response formats.

      sap.ui.model.odata.v2.ODataModel — HTTP-level entity creation

      Create new business entities (e.g., purchase orders, products) via direct HTTP POST.

      ODataError with ERR_ODATA_CSRF if CSRF token is missing.

      ODataError with ERR_ODATA_REQUEST_FAILED on HTTP error.

      const result = await createEntity(page, '/sap/opu/odata/sap/SVC/', 'Products', {
      Name: 'Widget',
      Price: 42,
      }, { csrfToken: token });