【发布时间】:2014-10-27 12:27:56
【问题描述】:
当我使用“Launch TestRunner”在我的项目中运行所有测试时,我在更新 SoapUI 中的项目属性时遇到了一些问题。
我有两个带有测试的 TestSuite。所有的测试用例都有第一步 - groovy 脚本。此脚本在所有测试用例中都相同:
Integer curIdAndKey = new Integer (testRunner.testCase.testSuite.project.getPropertyValue( "IdAndKey" ))
Boolean curBool = new Boolean (testRunner.testCase.testSuite.project.getPropertyValue( "bool" ))
Integer curTestsCount =new Integer( testRunner.testCase.testSuite.project.getPropertyValue( "countOfTests" ))
if(curBool==false){
curBool=true
curIdAndKey= curIdAndKey*curTestsCount
}
else {
curIdAndKey += 1
}
testRunner.testCase.setPropertyValue("aIdCase", curIdAndKey.toString())
testRunner.testCase.testSuite.project.setPropertyValue("bool", curBool.toString())
testRunner.testCase.testSuite.project.setPropertyValue("IdAndKey", curIdAndKey.toString())
log.info "Current Id : [$curIdAndKey]"
log.info "Current bool : [$curBool]"
我有一个项目属性:“IdAndKey”和“bool”。 当我运行单个 TestCase - 这个项目属性正在更新,但是当我运行所有测试时,它们没有更新(我只在日志中看到更新,但在属性中没有看到)。 请帮帮我。
【问题讨论】:
-
已经在这里回答了:stackoverflow.com/q/26460598/3124333
-
不,不一样。我需要从 SoapUI 而非命令行运行测试。
-
您说:... 使用“启动 TestRunner”。这样就一样了!