Groovy 我们可以在soapui中使用闭包来获得每个测试用例的测试执行吗
我在soapui中有大约400个测试用例。。它没有开始时间和结束时间,或者测试用例的总执行未添加到自定义报告中。我可以通过在每个测试用例中的分解脚本中添加一个脚本来实现这一点。但由于我有400个测试用例,所以它几乎不需要花费时间。在groovy中使用闭包有什么方法可以实现吗Groovy 我们可以在soapui中使用闭包来获得每个测试用例的测试执行吗,groovy,soapui,Groovy,Soapui,我在soapui中有大约400个测试用例。。它没有开始时间和结束时间,或者测试用例的总执行未添加到自定义报告中。我可以通过在每个测试用例中的分解脚本中添加一个脚本来实现这一点。但由于我有400个测试用例,所以它几乎不需要花费时间。在groovy中使用闭包有什么方法可以实现吗 谢谢这是一个在整个项目中设置拆卸的示例 def project = testRunner.getTestCase().getTestSuite().getProject().getWorkspace().getPro
谢谢这是一个在整个项目中设置拆卸的示例
def project = testRunner.getTestCase().getTestSuite().getProject().getWorkspace().getProjectByName("MyProject");
//TearDownTemplate
def tearDownTemplate = """
/*BEGINNING CUSTOM TEARDOWN FOR THIS TESTCASE ONLY*/
//Reserved for this testcase only, because the teardown is populated automaticly, we don't want to loose some work if we need specials things.
/*END OF CUSTOM TEARDOWN HERE £££*/
// Common teardown for all testcases Here
// Here do the stuff for your time execution
""";
//Loop through each Test Suite in the project
for(suite in project.getTestSuiteList()) {
//Loop through each Test Case
for(tcase in suite.getTestCaseList()) {
teardown = tcase.getTearDownScript();
if(teardown != null){
// we split the teardownTemplate and the teardown already set by our delimiter '£££'
def fields = teardown.tokenize("£££");
def fieldsTemplate = tearDownTemplate.tokenize("£££");
//teardown replacement
tcase.setTearDownScript(fields[0] + "£££" + fieldsTemplate[1]);
}else{
tcase.setTearDownScript(tearDownTemplate);
}
}
}
log.info 'finished'
您是否已经有
拆卸脚本
?如果你能在问题中加上它就好了?你到底想在报告中写什么?样本报告会有所帮助。你想要什么样的报告?html?纯文本?这是关于报告生成的另一个问题,早就得到了回答。可能不相关,但请看一看@Rao,我没有拆掉的剧本。。我想要每个套件的总执行时间..就像卡管理开始时间:xxx和结束时间:xxxx或总执行时间:xxx但是,问题是测试用例?不管怎样,您得到了多少套件?您还可以使用脚本用模板填充所有测试用例中的所有拆卸。我使用这个方法来填充1500多个测试用例,它在不到2秒内运行。