Properties 在soapUI groovy脚本中使用testname作为属性

Properties 在soapUI groovy脚本中使用testname作为属性,properties,groovy,soapui,Properties,Groovy,Soapui,我想将测试名称附加到结果日志中 我在“TestCase属性”中看到“name” 但是,当我右键单击groovy脚本并尝试获取数据时, 我找不到测试名称..我不确定您在哪里尝试这样做,但是如果您要向测试用例添加新的“Groovy脚本测试步骤”,添加名称日志非常简单: log.info(context.testCase.name) 我试图将testdata记录到一个外部文件中,下面的脚本运行正常。。def today=new Date()formattedDate=today.format('yy

我想将测试名称附加到结果日志中

我在“TestCase属性”中看到“name”

但是,当我右键单击groovy脚本并尝试获取数据时,
我找不到测试名称..

我不确定您在哪里尝试这样做,但是如果您要向测试用例添加新的“Groovy脚本测试步骤”,添加名称日志非常简单:

log.info(context.testCase.name)

我试图将testdata记录到一个外部文件中,下面的脚本运行正常。。def today=new Date()formattedDate=today.format('yyyy-MM-dd-HH')def file=new file('d:/test/test_'+formattedDate+'.txt')def testname=context.testCase.name.toUpperCase()如果((errorCode='X')&(result='Y')){file.append(testname+).errorCode=“+errorCode+”,result=“+result+”,PASSED\n”)}如果((errorCode=)其他{file.append(testname+).errorCode=”+errorCode+”,result=“+result+”,失败\n”)}