如何在空手道测试中在控制台中打印值

Shi*_*hna 7 rest karate

我正在尝试在控制台上打印值,但没有看到任何值

代码片段

And prepresp = response.event.txn_count
Then print 'count is : ',  response.event.txn_count
Then print 'count is : ',  prepresp
Run Code Online (Sandbox Code Playgroud)

Bab*_*ran 7

您的代码似乎缺少用于定义“prepresp”的“def”关键字

And def prepresp = response.event.txn_count 
Then print 'count is : ', response.event.txn_count 
Then print 'count is : ', prepresp
Run Code Online (Sandbox Code Playgroud)

这应该有效

  • @ShivaKrishna你的响应是一个数组,所以这样做:`* def count = response[0].EXPR$0` (2认同)