1. Run special step:

testRunner.runTestStepByName("stepName/requestName")

get it's response:

testRunner.testCase.testSteps["stepName/requestName"].testRequest.response

2.Set property

def setProperties(Name,Value,Place)
{
name = Name;
target = testRunner.testCase.getTestStepByName(Place);
target.setPropertyValue(name,Value);
}

3.Clean property

def cleanProperty(PropertyListName)
{
PropertyList = testRunner.testCase.getTestStepByName(PropertyListName);
size=PropertyList.getPropertyCount();
if (size!=0)
{
for (i=0;i<size;i++)
{
PropertyList.removeProperty(PropertyList.getPropertyAt(0).name);
}
}
}

4. Get response with XMLHolder

Rest request:

import com.eviware.soapui.support.XmlHolder

def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )
def holder = groovyUtils.getXmlHolder( "requestName#ResponseAsXml" )

Soap request:

import com.eviware.soapui.support.XmlHolder

def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )
def holder = groovyUtils.getXmlHolder( "requestName#Response" )

Groovy Script in SoapUI REST Testing的更多相关文章

  1. SoapUI Pro Project Solution Collection –Easy develop Groovy Script to improve SoapUI ability

    As you know the groovy script and java script language is the soapui supported .but unfortunately So ...

  2. Common tasks that you can perform with the Groovy Script test step

    https://support.smartbear.com/readyapi/docs/soapui/steps/groovy.html Get test case object To obtain ...

  3. How to use groovy script on jenkins

    1. Install groovy plugin 2. Add a step of groovy. (normal & systerm) 3. Execute groovy script im ...

  4. Access Java API in Groovy Script

    $ cat Hello.java package test; public class Hello { public int myadd(int x, int y) { return 10 * x + ...

  5. [SoapUI] 通过Groovy Script获取当前运行的是哪套Environment

    log.info testRunner.testCase.testSuite.project.getActiveEnvironment().getName()

  6. excel文件的groovy脚本在SoapUI中进行数据驱动测试

    SoapUI Pro具有从外部文件读取数据的功能,例如:excel,csv等.但SoapUI不提供从excel文件读取数据的功能.因此,为了从SoapUI中的excel文件中读取数据,我们需要在gro ...

  7. Setup Script in SoapUI - 停止项目运行 (abort project)

    TestSuite需要依赖一个先决条件(比如Login) 当Login失败则立即停止Project运行 在Project的Setup Script的代码如下 import com.eviware.so ...

  8. Elasticsearch的Groovy Script自定义评分检索

    需求:以索引中的boostapp列作为评分的基础分值,同时根据carpublishtime(数据的刷新时间字段)按时间进行衰减. 基于Groovy脚本实现. 1.query脚本方式: { " ...

  9. [Training Video - 5] [Groovy Script Test Step - Collections, Exceptions] Exception Handling in groovy

    def x = new String[3] x[0] = "A" x[1] = "B" x[2] = "C" log.info"X ...

随机推荐

  1. 发票OCR识别/票据OCR自动识别

    对于一些大的集团公司来说,分散式财务管理模式管理效率不高,管理成本相对较高,同时也制约了集团企业发展战略的实施,因而需要建设财务共享中心.一个企业想建造财务共享中心,面临的难题是大量的数据采集和信息处 ...

  2. spring 的单例模式

    singleton---单例模式 单例模式,在spring 中其实是scope(作用范围)参数的缺省设定值每个bean定义只生成一个对象实例,每次getBean请求获得的都是此实例 单例模式分为饿汉模 ...

  3. 【PHP】linux+php5.1.6+mysql5.0.2+apache2.0.55安装配置说明(转)

    linux+php5.1.6+mysql5.0.2+apache2.0.55安装配置说明:一.mysql5.0.2的安装配置过程及说明:1. #tar -zvxf mysql-5.0.2-alpha. ...

  4. 【MYSQL】ubuntu13安装mysql(转)

    安装的是mysql-5.0.87-linux-i686-glibc23.tar.gz 1.解压tar.gz tar –xzf mysql-5.0.87-linux-i686-glibc23.tar.g ...

  5. Python正则表达式指南(转)

    原文地址:http://www.cnblogs.com/huxi/archive/2010/07/04/1771073.html 1. 正则表达式基础 1.1. 简单介绍 正则表达式并不是Python ...

  6. Python学习记录----类型匹配(转)

    import types aaa = 0 print type(aaa) if type(aaa) is types.IntType: print "the type of aaa is i ...

  7. CI 结合 vue.js 的搜索功能模块

    CI 结合 vue.js 的搜索功能模块 最近在有优化公司后台的某个模块的搜索功能优化 原先的是这个样子的,很是单调: 老大给我找个图希望我能弄成这样子: 经过不断修改,最后成了这样子 是不是比以前好 ...

  8. [技术]浅谈OI中矩阵快速幂的用法

    前言 矩阵是高等代数学中的常见工具,也常见于统计分析等应用数学学科中,矩阵的运算是数值分析领域的重要问题. 基本介绍 (该部分为入门向,非入门选手可以跳过) 由 m行n列元素排列成的矩形阵列.矩阵里的 ...

  9. 【待整理】MySQL alter table modify vs alter table add产生state不一样

    MySQL:5.6.35 OS:redhat5.8 今天更新数据库某些表字段,有如下两SQL: ①alter table xx modify xxxx;(表大概是77w) ②alter table s ...

  10. JS高级编程读书笔记

    导读:由于书的内容较多,内容划分也非常详尽,所以会分好几篇来写. 此页面仅作为跳转,权当个目录来用. 我会分块进行整理,大致如下: 第一章 简介 讲述javascript的历史,不打算整理,同学们大概 ...