// Remove all custom properties on Project level. If removed, custom properties cannnot be injected to Project in new environment except default env
def removeProjectProperties(){
def propertyNames = testRunner.testCase.testSuite.project.getPropertyNames()
for (int i=0; i<propertyNames.size();i++){
testRunner.testCase.testSuite.project.removeProperty(propertyNames[i])
}
} // Remove all custom properties on TestSuite level
def removeTestSuiteProperties(){
def testSuiteList = testRunner.testCase.testSuite.project.getTestSuites()
def testSuiteName
for (testSuite in testSuiteList){
testSuiteName = testSuite.toString().split('=')[0]
def ts = testRunner.testCase.testSuite.project.getTestSuiteByName(testSuiteName)
def propertyNames = ts.getPropertyNames()
for (int i=0; i<propertyNames.size();i++){
ts.removeProperty(propertyNames[i])
}
}
} // Remove all custom properties on TestCase level
def removeTestCaseProperties(){
def testSuiteList = testRunner.testCase.testSuite.project.getTestSuites()
def testSuiteName
for (testSuite in testSuiteList){
testSuiteName = testSuite.toString().split('=')[0]
def testCaseList = testRunner.testCase.testSuite.project.getTestSuiteByName(testSuiteName).getTestCases()
def testCaseName
for (testCase in testCaseList){
testCaseName = testCase.toString().split('=')[0]
def tc = testRunner.testCase.testSuite.project.getTestSuiteByName(testSuiteName).getTestCaseByName(testCaseName)
def propertyNames = tc.getPropertyNames()
for (int i=0; i<propertyNames.size();i++){
tc.removeProperty(propertyNames[i])
}
}
}
}

移除project,testsuite,testcase级别所有的custom properties的更多相关文章

  1. Groovy解析xml并且注入Project,TestSuite,TestCase级别的custom properties

    import com.eviware.soapui.support.GroovyUtils import groovy.util.XmlParser def groovyUtils = new Gro ...

  2. 在当前TestSuite/TestCase run之前先run另一个TestSuite/TestCase

    在当前的TestSuite/TestCase的Setup Script里面写上这段代码: import com.eviware.soapui.model.support.PropertiesMap l ...

  3. soapUI 使用Property

    DRY 原则是一个比较普适的东西,在使用soapUI测试的时候,为了make life easy,我们必须要使用Property来集中化一些设置. 比如说从dev->test->uat 的 ...

  4. [SoapUI] 在执行某个TestSuite之前先执行login或者其他什么前置步骤

    打开TestSuite有一个地方可以设置Setup Script import com.eviware.soapui.model.support.PropertiesMap log.info &quo ...

  5. soapui groovy脚本汇总

    出处:https://www.jianshu.com/p/ce6f8a1f66f4 一.一些内部元件的访问 testRunner.testCase开头 1.向下访问 testRunner.testCa ...

  6. SoapUI对于Json数据进行属性值获取与传递

    SoapUI的Property Transfer功能可以很好地对接口请求返回的数据进行参数属性获取与传递,但对于Json数据,SoapUI会把数据格式先转换成XML格式,但实际情况却是,转换后的XML ...

  7. 使用 soapUI 测试 REST 服务

    REST 服务介绍 REST(Representational State Transfer)是 Roy Fielding 博士在 2000 年提出的一种新的软件架构风格,它以资源(resource) ...

  8. [SoapUI] SoapUI可以做到些什么?功能有多强大?

    SoapUI. The Swiss-Army Knife of Testing. Whether you’re a tester, developer, business analyst, or ma ...

  9. Mybatis使用Dao代码方式CURD

    Mybatis 使用Dao代码方式进行增.删.改.查. 1.Maven的pom.xml <project xmlns="http://maven.apache.org/POM/4.0. ...

随机推荐

  1. 【转】linux中do{...} while(0)的解释

    在看ldlm的代码过程中遇到了一个很奇怪的问题,有很多宏定义使用了do while(0)这种看起来好像没啥用的代码.然后我就问问师兄,才得知,这种用法很常见,自己又查了一下资料,原来在linux内核代 ...

  2. JQuery_元素样式操作

    元素样式操作包括了直接设置CSS 样式.增加CSS 类别.类别切换.删除类别这几种操作方法.而在整个jQuery 使用频率上来看,CSS 样式的操作也是极高的,所以需要重点掌握.  一.css()方法 ...

  3. mysql操作查询结果case when then else end用法举例

    Case具有两种格式.简单Case函数和Case搜索函数. --简单Case函数 CASE sex          WHEN '1' THEN '男'          WHEN '2' THEN ...

  4. java中的IO操作

    IO流是用来处理设备之间的数据传输,Java对数据的操作是通过流的方式进行,而操作流的对象都封装到java.io包中.根据操作数据的种类可以把IO流分为字节流(InputStream,OutputSt ...

  5. Java源文件编译成功但是运行时加载不到文件

    最近系统重装了一些,Java等环境变量都需要重新配置,配置好以后编写了一个Java源文件编译了一下,通过Javac编译源文件,编译成功,但是再通过Java运行时没找到报出找不到加载文件或者加载文件不存 ...

  6. WPF 数据绑定Binding

    什么是数据绑定? Windows Presentation Foundation (WPF) 数据绑定为应用程序提供了一种简单而一致的方法来显示数据以及与数据交互. 通过数据绑定,您可以对两个不同对象 ...

  7. Mat转换为QImage

    请留意: opencv为3.0.0版本,Qt为4.8.4版本 #include"image1.h" #include<QApplication> #include< ...

  8. Hprose question

    1 在服务端 接口的开发中 如果定义了index()方法 中间不能够有参数,否则报错. 2 接口方法中的参数 最好使用单参数 如fun($uid ) 或者 如果需要多个参数 fun($param){$ ...

  9. FPGA图像处理 两路sensor的色调不一致

    怎么调?可以让两路sensor的色调一致.

  10. 提高ASP.NET应用程序性能的十大方法

    一.返回多个数据集 检查你的访问数据库的代码,看是否存在着要返回多次的请求.每次往返降低了你的应用程序的每秒能够响应请求的次数.通过在单个数据库请求中返回多个结果集,可以减少与数据库通信的时间,使你的 ...