KeyId:secretKey和KeyId:'#(secretKey)'`之间有什么区别?

问题描述 投票:1回答:1

我对此票有疑问Using karate-config parameters in a feature file

之间有什么区别KeyId: secretKey,和KeyId: '#(secretKey)'?是否可以在未分配def的情况下使用apiKey?喜欢* print "Key in this project is #apiKey"谢谢

karate
1个回答
0
投票

您问了3个问题:

a)请阅读:https://github.com/intuit/karate#karate-expressions

b)请阅读:https://github.com/intuit/karate#embedded-expressions

c)请阅读:https://github.com/intuit/karate#print

例如:

* def val = 'bar'
# correct
* def temp = { foo: '#(val)' } 
# wrong
* def temp = { foo: val }
# correct but not recommended
* def temp = ({ foo: val })
# variables are easy to use, forget about the # part
* print 'value of val:', val
© www.soinside.com 2019 - 2024. All rights reserved.