如何在类路径中使用嵌入式表达式 [英] how to use embedded expression with classpath
问题描述
我正在尝试将文件的绝对值传递给classpath的读取函数.
I am trying to pass the absolute value of a file to the read function for classpath.
如果我将绝对路径与classpath一起传递,则可以正常工作.但是当我通过嵌入式表达式时,它不起作用
If I pass absolute path along with classpath it works fine. But when I pass embedded expression its not working
我的代码如下
Scenario: create swagger first RAD
给出url appServer给定参数creationMethod ='SWAGGER_FIRST'和路径"/integration/rest/rad"
Given url appServer Given param creationMethod = 'SWAGGER_FIRST' And path '/integration/rest/rad'
头X-CSRF-TOKEN = csrfToken* Cookie JSESSIONID = jsessionid* Cookie路线=路线值*配置字符集= null
And header X-CSRF-TOKEN = csrfToken * cookie JSESSIONID = jsessionid * cookie route = routevalue * configure charset = null
- 打印swaggerDetailsinputFile
- 打印swaggerInputJsonFile给定多部分文件inputData = {读取:'classpath:#(swaggerDetailsinputFile)',文件名:'blob',contentType:'application/json'}给定多部分文件swaggerFile = {读取:'classpath:ic/feature/RAD/swagger.json',文件名:'blob',contentType:'application/json'}和标题Content-Type ='multipart/form-data'方法发布时
需要一种将嵌入式表达式传递给读取函数的类路径值的方法
Need a way to pass embedded expression to classpath value for read function
推荐答案
尝试一下:
read: '#("classpath:" + swaggerDetailsinputFile)'
确保您已阅读文档的这一部分: https://github.com/intuit/karate#rules-for-embedded-expressions
Make sure you read this part of the docs: https://github.com/intuit/karate#rules-for-embedded-expressions
这篇关于如何在类路径中使用嵌入式表达式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!