SoapUI Properties的使用
Link:http://testautomationnoob.blogspot.com/2012/10/soapui-properties-and-property-related.html
soapUI: Properties
Properties are available at multiple levels in soapUI, including the
environment, system, global, project, test suite, test case, and test
step levels. System properties are visible in the Help - System
Properties window. Global properties can be viewed or set in the File -
Preferences window. Properties for other levels are visible in the
Navigator panel when you click on the relevant node.

Project properties panel
In some cases, properties can also be loaded from or saved to external
files (see the screenshot below of a test suite Custom Properties tab;
the two rightmost icons at the top of the dialog are for loading and
saving from external files). Properties are saved in the file in propertyname=propertyvalue pairs; e.g.:
ElName=Mercury
ExpectedVal=80
Properties can be referenced (soapUI documentation calls this property expansion) from
almost anywhere in soapUI-- in Contains assertions as the string to
match, within a request, etc. To reference a property, the general
syntax is "${[#PropertyScope#]PropertyName[#XPathExpression]}". PropertyScope can
be "Env", "System", "Global", "Project", "TestSuite", and "TestCase"
(in the screenshot above, the Hermes Config property references the
user.home System property). To reference properties from a preceding
test step, the syntax is "${TestStepName#PropertyName[#XPathExpression]}--
note that the leading hash mark (#) before the scope is omitted when
referencing a test step. The test step where you're putting your
reference and the test step being referenced must be within the same
test case. XPath expressions are optional and only valid where the
property being referenced is valid XML (for test requests, the request
and response are both made available as properties).
Let's go back to the test suite created in the last post for
our Periodic Table web service. Note that three of the four operations
provided by the web service take an element name as their input
parameter: GetAtomicNumber, GetAtomicWeight, GetElementSymbol. Suppose
we wanted to use the same element to test all three. Instead of
hard-coding an element into our requests, we can define a test suite
level property and then use that property in all three of our test
requests.
Let's try that now. In the Navigator panel, click on the test suite
node. In the Properties panel (click the Properties button at the
bottom of the Navigator panel if you don't see it), click on the "Custom
Properties" tab, and add a new property called ElNameProp (via the
left-most button at the top), giving it "Silver" as its value.

ElNameProp created at the test suite level
Now go into the GetAtomicNumber, GetAtomicWeight, and GetElementSymbol
test requests and modify each to use our test suite's ElNameProp where
an element name is required. Our reference expression is
"${#TestSuite#ElNameProp}". Here's the reference in the GetAtomicNumber
test request:

ElNameProp used in the GetAtomicNumber test request
Now try running each of the modified test requests-- the value "Silver"
is plugged into each of the requests where we reference our ElNameProp
property (you can see some of the appropriate response data for the
GetAtomicNumber request in the screenshot above).
SoapUI Properties的使用的更多相关文章
- soapUI参数中文乱码问题解决方法 (groovy脚本中文乱码)
soapUI参数中文乱码问题解决方法 可能方案1: 字体不支持中文,将字体修改即可: file-preferences-editor settings-select font 修改字体,改成能显示中文 ...
- 使用 soapUI 测试 REST 服务
REST 服务介绍 REST(Representational State Transfer)是 Roy Fielding 博士在 2000 年提出的一种新的软件架构风格,它以资源(resource) ...
- soapUI参数中文乱码问题解决方法&soap UI工具进行web接口测试
soapUI参数中文乱码问题解决方法 可能方案1: 字体不支持中文,将字体修改即可: file-preferences-editor settings-select font 修改字体,改成能显示中文 ...
- How To Fix soapUI JVM Maximum Heap Size (-Xmx) Error [Solution]
http://quicksoftwaretesting.com/soapui-jvm-heap-size-xmx-error/ -Xms128m -Xmx1000m -Dsoapui.properti ...
- SoapUI乱码问题处理方法
前言 每个工具都会有一些意想不到的“坑”,SoapUI也不例外.无论是参数或者响应报文,大家可能都遇到过乱码问题,这里记录一下几种解决乱码的方法. 一.修改显示字体 在File>>> ...
- [SoapUI] 配置默认环境的properties
<Envs> <Env id="Live,Default environment"> <Project> <CusProperty nam ...
- SOAPUI使用教程-MockService脚本概述
虽然静态MockOperation和MockResponse模型可以给你一定的灵活性,更多的动态行为添加到您的服务让您更模拟复杂的服务功能是很有用的.例如,你可能想: 从请求到响应传输值,修改它们的值 ...
- 接口测试SoapUI参数化
上次和大家一起完成了soapui的参数之一properties,今天我们一起交流另外一种参数化的方法,跟着一起练习,不懂不要紧,练习多了就会慢慢懂的: 1.准备excle(目前soapui只支持xls ...
- Groovy解析xml并且注入Project,TestSuite,TestCase级别的custom properties
import com.eviware.soapui.support.GroovyUtils import groovy.util.XmlParser def groovyUtils = new Gro ...
随机推荐
- python request (1) 环境
环境准备 requests httpbin virtualenv pip python 安装 #mkdir /home/requests #yum install -y python-pip ...
- c++primer-p100.用迭代器进行二分法搜索
#include <vector> #include <iostream> using namespace std; int main() { vector<int> ...
- 数据库监听。数据库一次notify,Activity多次接收
今天项目中发现一个bug: (1)当uri数据库中有更新,会从数据库层DataService中通知应用层,调用notifyChange: mContext.getContentResolver().n ...
- linux中创建图片服务器减轻传统服务器的压力
1.1. 传统项目中的图片管理 传统项目中,可以在web项目中添加一个文件夹,来存放上传的图片.例如在工程的根目录WebRoot下创建一个images文件夹.把图片存放在此文件夹中就可以直接使用在 ...
- Codeforces 1076E Vasya and a Tree(树状数组)或dfs
题意:给你一颗以1为根节点的树,初始所有节点的权值为0,然后有m个操作,每个操作将点x的所有距离不超过d的节点权值+1,问经过m次操作后每个节点权值是多少? 思路:如果是一个序列,就可以直接用树状数组 ...
- SpringBoot12 QueryDSL02之利用QueryDSL实现多表关联查询
1 业务需求 有的系统业务逻辑比较复杂,存在着多表关联查询的的情况,查询的内容不仅仅是单张表的的内容而是多张表的字段组合而成的,直接使用SplringDataJPA实现是比较复杂的,但是如果使用Que ...
- 时间获取_Date\SimpleDateFormat\Calendar类
1.获取当前的日期,并把这个日期转换为指定格式的字符串,如2088-08-08 08:08:08 import java.text.SimpleDateFormat; import java.uti ...
- 在Ubuntu里启用root账号
我的系统环境, 操作系统:Win7 虚拟机软件:VMware workstation 12 在虚拟机里安装了Ubuntu 18,安装时的账号frank,在安装其它软件的时候,报权限不足,因此,准备启用 ...
- Linux 设置新创建目录或文件的默认权限
一.简介 在unix或者linux中,每创建一个文件或者目录时,这个文件或者目录都具有一个默认的权限,比如目录755,文件644,这些默认权限是通过"umask"权限掩码控制的.一 ...
- Luogu 3292 [SCOI2016]幸运数字
BZOJ 4568. 感觉很板. 前置技能:线性基. 放一篇感觉讲的比较丰富的博客: 戳这里. 首先要求在一个序列中任意选点使得异或和最大,当然是想到线性基了. 把问题转换到树上,如果每次询 ...