當我使用「啓動TestRunner」在我的項目中運行所有測試時,我在SoapUI中更新項目屬性時遇到了一些問題。SoapUI:爲什麼當我使用Testrunner運行所有測試時項目屬性沒有更新
我有兩個TestSuites測試。所有的TestCases都有第一步 - groovy腳本。這個腳本在所有TestCases中都是一樣的:
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 - 這個項目屬性正在更新,但是當我運行我所有的測試時,他們沒有更新(我看到更新只在日誌中,但沒有在屬性中)。 請幫幫我。
已經在這裏得到解答:http://stackoverflow.com/q/26460598/3124333 – SiKing 2014-10-27 15:02:50
不,這是不一樣的。我需要從SoapUI運行測試,而不是從命令行運行。 – 2014-10-27 17:41:11
你說過:「推出TestRunner」。這使它一樣! – SiKing 2014-10-27 17:46:41