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 ...
随机推荐
- 12-19Windows窗体应用程序之记事本(2)
之前记事本的功能实现了“文件”和“编辑”中的功能操作,现在再继续下面的功能介绍: 3) <1>字体设置 [查看代码] [效果图] <2>字体颜色的设置 [查看代码] [效果图] ...
- js将数组中一个或多个字段相同的子元素中合并
最近js中遇到js将数组中一个或多个字段相同的子元素中合并,相信很多朋友也有遇到,大家可能有多种方法,我在这里记录一个相对简单的方法,当然大家如有其它更好的方法,请提出来大家共同学习. //将经济事项 ...
- javascript的概述
JavaScript是怎么诞生的???刚开始的是为了验证表单而开发出来的. 什么是JavaScript???a.面向对象的编程语言b.解释性的编程语言(说白了就是不用编译的一种语言)c.脚本语言(说白 ...
- Java知识点总结1
1.java的引用传递和值传递 当一个对象被当作参数传递到一个方法后,此方法可改变这个对象的属性,并可返回变化后的结果,那么这里到底是值传递还是引用传递? 答:是值传递.Java 编程语言只有值传递参 ...
- Easyui datebox单击文本框显示日期选择 eayui版本1.5.4.1
Easyui默认是点击文本框后面的图标显示日期,体验很不好,所以我想单击文本框就显示日期选择框,网上很多版本是1.3,1.4的,于是自己就比葫芦画瓢改了一个1.5.4.1的版本. 我参考了网上这个帖子 ...
- java中静态方法和非静态方法调用的一点小困扰,已解决。
public static void main(String[] args) { // TODO Auto-generated method stub SimpleGui1B gui=new Simp ...
- GCD 学习(二)dispatch_queue_create创建Dispatch Queue
摘录于: http://zhuyanfeng.com/archives/3042 dispatch_queue_create 用于创建用户线程队列.可以创建Serial/Concurrent Disp ...
- SQL Server相关知识和经验的碎片化记录
1.在向服务器发送请求时发生传输级错误 在向服务器发送请求时发生传输级错误. (provider: TCP 提供程序, error: 0 - 远程主机强迫关闭了一个现有的连接.) ---> Sy ...
- java全栈day05--ArrayList的基本功能
在前面我们学习了数组,数组可以保存多个元素,但在某些情况下无法确定到底要保存多少个元素,此时数组将不再适用,因为数组的长度不可变.例如,要保存一个学校的学生,由于不停有新生来报道,同时也有学生毕业离开 ...
- python连接数据库--查询数据
#!/usr/bin/python # -*- coding: utf-8 -*- import pymysql def fileDB(): # 打开数据库连接(ip/数据库用户名/登录密码/数据库名 ...