#3022·karate

Dynamic `read` parameters fail

Author: arnaldopCreated Aug 24, 2026Updated Aug 26, 2026
Labelsbugfixed

Description

Variables used as parameters to read() do not get processed.

Steps to Reproduce

    * def fileExtension = testData.file.name.substring(testData.file.name.lastIndexOf('.') + 1)
    * call read('this:../file/upload-' + fileExtension + '-file.reusable.feature') { file: statementFileLocation + testData.file.name, filename: testData.file.name }

Expected Behavior

Engine to read

/corp/work/2571-karate-v2-fresh/backend/src/karate/com/corp/commission/file/upload-xlsx-file.reusable.feature

or

/corp/work/2571-karate-v2-fresh/backend/src/karate/com/corp/commission/file/upload-csv-file.reusable.feature

Actual Behavior

called feature failed: src/karate/com/corp/commission/statement/create-statement-with-file.reusable.feature - Failed to read text from: /corp/work/2571-karate-v2-fresh/backend/src/karate/com/corp/commission/file/upload-' + fileExtension + '-file.reusable.feature

Karate Version

2.1.2

Java Version

23

Operating System

macOS