奶霜是什么| sec是什么意思| 打完狂犬疫苗有什么不良反应| 中蛊什么意思| 左侧上颌窦炎是什么病| 马是什么牌子的车| 梦见穿新裤子是什么意思| 胎盘血池是什么意思| 女生真空是什么意思| 缄默是什么意思| 第三代身份证什么时候开始办理| 肾功能四项检查什么| 大学辅导员是干什么的| 12月初是什么星座| 尿血什么原因| sid是什么意思| 蜈蚣泡酒有什么功效| 琪字五行属什么| 梦见割草是什么意思| 1955年是什么年| 他达拉非是什么药| 士字五行属什么| 中医湿气重是什么意思| 乳头疼是什么原因| 脂肪肝适合吃什么食物| 同房后出血什么原因| 春晓的晓是什么意思| 棘突是什么意思| 黑匣子什么颜色| 不景气是什么意思| 安全总监是什么级别| 羽立读什么| 大脑精神紊乱什么病| 黄菡和黄澜什么关系| me是什么基团| 前列腺特异性抗原是什么意思| 孕吐一般什么时候开始| 访谈是什么意思| 什么叫化学性肝损伤| 向日葵代表什么象征意义| 经常做春梦是什么原因| 尿路感染用什么药好| 表面抗原阳性是什么意思| 颅脑平扫是检查什么| bodywash是什么意思| 什么是自慰| 为什么会得荨麻疹呢| 拉肚子恶心想吐吃什么药| 肌肉拉伤吃什么药| 同学生日送什么礼物| 喉咙痛吃什么药| 吃银耳有什么好处和坏处| 可怜巴巴的意思是什么| 1999年属兔是什么命| 流清水鼻涕吃什么药| 官运是什么意思| 血脂稠吃什么好| 血糖高喝什么茶好| 肝风是什么意思| reebok是什么牌子| 客家人什么意思| 做蹲起有什么好处| 足癣用什么药最快好| 做梦梦到蜘蛛是什么意思| 拿手机手抖是什么原因| hoka是什么牌子| 头臀长是什么意思| 什么虫咬了起水泡| 低gi是什么意思| 铁皮石斛能治什么病| 葡萄像什么| 右眼皮跳是什么原因| 海淘是什么意思啊| 山茱萸是什么| 1977属什么生肖| 上海有什么景点| ed是什么意思| 五月二十五是什么星座| 子宫肌瘤挂什么科| 结扎是什么意思| 蓝绿色是什么颜色| 今天是什么好日子| 割包为什么很多人后悔| 高血压一级是什么意思| 什么是贵妇脸| 水瓶座和什么座最配对| 病毒性发烧吃什么药| 11月29日什么星座| 肠胃炎吃什么| 回头鱼是什么鱼| 肾阴虚吃什么食物最好| 肝癌有什么症状| 梦见大蟒蛇是什么征兆| 取保候审需要什么条件| 还有什么| 身上长白斑是什么原因造成的| 头发容易断是什么原因| 毛泽东什么时候死的| 肾虚吃什么药最有效| 女性大腿酸痛什么原因| 俞伯牙摔琴谢知音摔的是什么乐器| 什么菜| 宋江代表什么生肖| 什么是sm| 遥远的什么| 火车上不能带什么| 什么的爱心| 胱抑素c高是什么原因| 双侧乳腺小叶增生是什么意思| 吃什么帮助消化| 梦见抬死人是什么意思| 怕痒的男人意味着什么| 多肉是什么| 鼻毛变白什么征兆| 炎症是什么原因引起的| 吃炒黄豆有什么好处和坏处| 孕妇生气对胎儿有什么影响| 水代表什么数字| 眼睛视物模糊是什么原因| 1981年属鸡是什么命| 阿尔茨海默症是什么病| 乙肝是什么病严重吗| 属鸡的守护神是什么菩萨| 肥皂是什么做的| 什么夫妻百事哀| 凯字五行属什么| 口腔溃疡反复发作是什么原因| 手为什么会掉皮| 1988年出生是什么命| au是什么货币| 十月十二号是什么星座| 脑震荡吃什么药| borel手表是什么牌子| 吃什么东西补血快| 硬发质适合什么发型| 615是什么星座| 兵马俑什么时候发现的| 狗狗蛋蛋红肿是什么原因| 玉皇大帝的老婆叫什么| 3月3日是什么节| 长生香是什么意思| 梭子蟹什么时候上市| 急救物品五定是什么| 大小脸挂什么科| 什么是僵尸肉| 右肋骨下方是什么器官| 甜杆和甘蔗有什么区别| 上证指数是什么意思| 尿糖是什么意思| 无创是什么| 关节痛挂号挂什么科| 尾盘拉升意味着什么| 脑死亡是什么原因引起的| 冬虫夏草到底是什么| 夏天适合吃什么菜| 男生为什么会遗精| 肉沫炒什么好吃| 尿路感染吃什么药效果好| ib是什么意思| 左下腹有什么器官| 官方的意思是什么| mds是什么意思| 葫芦是什么生肖| 金匮肾气丸有什么作用| 下焦湿热阴囊潮湿吃什么药| 七个小矮人分别叫什么| 1955年是什么年| 爽文是什么意思| 什么病才吃阿昔洛韦片| 鬼迷日眼是什么意思| 坐月子什么意思| 奉天为什么改名沈阳| 牛排炖什么好吃| 吃什么能降低尿蛋白| 跳蚤长什么样子图片| 头晕恶心是什么原因| 啵啵是什么| 万事顺意是什么意思| 动脉导管未闭对宝宝有什么影响| 未什么意思| 右手手指头麻木是什么病的前兆| 什么人群不适合吃阿胶糕| 二月一号是什么星座| 迷离的眼神什么意思| 眼镜发明之前眼镜蛇叫什么| 什么是心脏早搏| 全心增大是什么意思| brush是什么意思| 黑鱼吃什么食物| 为什么疤痕会增生| 氨曲南是什么药| 夏天什么时候最热| 甲状腺减退什么症状| 化验大便能查出什么病| 清高是什么意思| 利湿是什么意思| 拜金是什么意思| 燕条和燕盏有什么区别| 1990年是什么年| 排卵期为什么会出血| 脚上起水泡用什么药膏| 面基是什么意思| 转氨酶异常是什么意思| 记者学什么专业| 日柱国印是什么意思| 吃什么治疗阳痿| 丑未相冲的结果是什么| AUx是什么品牌| 时间单位是什么| 七月是什么月| 10.1什么星座| 眼花缭乱什么意思| 人流后吃什么| 孩子睡觉出汗多是什么原因| 梦见拉麦子是什么预兆| 去侍庙有什么禁忌| 胎盘低是什么原因造成的| 人得猫癣用什么药| 心梗吃什么药效果好| 史铁生为什么瘫痪| 手抽筋是什么病的前兆| 牙齿酸是什么原因| 左眉上方有痣代表什么| 血虚吃什么好| 反酸是什么感觉| 寅木代表什么| 尿潴留是什么病| 腿凉是什么原因引起的| 保释金是什么意思| 外感发热什么意思| 洋姜有什么功效与作用| 傻人有傻福什么意思| 法西斯战争是什么意思| 夏天为什么会下冰雹| 幽门螺杆菌阳性是什么意思| 室性期前收缩是什么病| 眼睛流泪用什么药| 42天产后检查挂什么科| 宫腔粘连有什么症状| 胃挂什么科| blub是什么意思| 吃什么补心| 上日下成念什么| 为什么生化妊娠是好事| 老化是什么意思| 嘴苦是什么原因造成的| 长期便秘是什么原因引起的| 神经内科看什么病的| 砧板是什么工作| 西米露是什么| 百米12秒什么水平| miko是什么意思| 生育能力检查挂什么科| 白细胞低什么原因| 落空是什么意思| 荔枝是什么意思| 耳朵旁边长痘痘是什么原因| 歧视什么意思| 7月份是什么季节| 什么药能提高免疫力| 右额头上有痣代表什么| 中药龙骨是什么| 痛经是什么| ca724偏高是什么意思| 百度

车讯:涉及2200余辆 一汽-大众召回部分奥迪Q7

百度 乔旭建议,设立“优秀大学生工程师计划”,在政府的支持下鼓励大学生进入企业一线,并在税收、住房、子女入学等方面给予优惠,同时企业也要对参与创新的大学生给予股权激励,以吸引并留住优秀人才。

NOTE: This page contains information on standalone SoapUI Pro that has been replaced with ReadyAPI.
To try enhanced scripting functionality, feel free to download a ReadyAPI trial from our website.

SoapUI provides extensive options for scripting, using either Groovy or Javascript (since SoapUI 3.0) as its scripting language, which to use is set a the project level in the project details tab at the bottom left. The majority of the documentation available here will be for the Groovy language, as it greatly simplifies the scripting of Java APIs (you can get more information, tutorials, etc on the Groovy Web Site). An overview of how to use JavaScript instead is further down in this document.

Scripts can be used at the following places in SoapUI:

  • As part of a TestCase with the Groovy Script TestStep, allowing your tests to perform virtually any desired functionality
  • Before and after running a TestCase or TestSuite for initializing and cleaning up before or after running your tests.
  • When starting/stopping a MockService to initializing or cleaning-up MockService state
  • When opening/closing a Project, for initializing or cleaning-up Project related settings
  • As a dynamic DataSource or DataSink with the corresponding DataSource/DataSink test steps
  • For providing dynamic MockOperation dispatching.
  • For creating dynamic MockResponse content
  • For creating arbitrary assertions with the Script Assertion
  • To extend SoapUI itself (see Extending SoapUI), for adding arbitrary functionality to the SoapUI core

All scripts have access to a number of situation-specific variables, always including a log object for logging to the Groovy Log and a context object for perform context-specific PropertyExpansions or property handling if applicable. A context-specific variable is always available for directly accessing the SoapUI object model.

1. Script Editors

Script editors are generally available as inspectors at the bottom of the corresponding objects editor, each having a run button, a drop-down edit menu (same as the right-click popup), an information label, and a help button;

script-editor

The popup-menu (as shown above) contains standard edit-related actions and will in ReadyAPI contain a "Get Data" menu option that expands to show all properties available within the current scope. Selecting a property (or the option to create a new one) will eventually create a script to get the variable, for example

def test = context.expand( '${#Project#test}' )

Which gets the Project-level "test" property.

It is also possible to drag a property from the navigator tree when it is in Property Mode into the script; if the dragged property is "within scope" (i.e. can be accessed via property expansion), the corresponding access script will be created at the caret location

2. Groovy Script Library

You can have a central library of Groovy Classes that can be accessed from any script, which can be useful for centralizing common tasks and functionality and for creating extensions.

Groovy Script Library

The Script Library can be used as follows;

  • Specify which directory to use in the SoapUI Preferences tab (default is /scripts). SoapUI will check this directory for files with the "Groovy" extension and compile these upon startup. The directory is then checked periodically (every 5 seconds) for updates and new or existing scripts are compiled and re-compiled if necessary.
  • Scripts should be placed in directories named after their containing package, that is a script in the package soapui.demo should be in a soapui/demo directory under the specified scripts directory.
  • The compiled classes are added to the parent class loader of all Groovy scripts, you can access them as standard java classes.

Remember that the script files must be valid classes, not just arbitrary scripts. So as an example, lets setup one of these Groovy objects. First, create a directory (e.g. C:\GroovyLib). Then add a Callee.groovy file in that directory with the following content:

package readyapi.demo
 
//Callee.groovy
class Callee {
 
  String hello() {
     return "Hello world! "
  }
 
  def static salute( who, log ) { log.info "Hello again $who!" }
}

Now let's setup SoapUI to load up your Groovy library. Set File > Preferences > SoapUI tab > Script Library.

So we would set that to "C:\GroovyLib" in our example.

Then we restart SoapUI to pick up the library script.

Now if we create a Groovy Script Step in a TestCase, we can use the above class from the library with the following:

//Caller.groovy
c = new Callee()
log.info c.hello()

Running this from within the Groovy Editor will show the following in the Groovy Editors log:

Tue MONTH 29 10:56:08 EST YEAR:INFO:Hello world!

Modifying Script File

If we modify the Callee.groovy file:

package readyapi.demo
//Callee.groovy
class Callee {
 
  String hello() {
     return "Hello world! "
  }
 
  String hello(String who) {
     return "Hello $who"
  }
 
  def static salute( who, log ) { log.info "Hello again $who!" }
}

SoapUI will pick up the modified file (once it has been saved), which is seen in the log:

Tue MONTH 29 10:56:08 EST YEAR:INFO:C:\GroovyLib\Callee.groovy is new or has changed, reloading...

We also change the script:

    //Caller.groovy
    c = new Callee()
    log.info c.hello("Mike")

And we get:

Tue MONTH 29 10:56:08 EST YEAR:INFO:Hello, Mike!

Static Method

We can also call the static salute method:

    readyapi.demo.Callee.salute( "Mike", log )

Which will produce the following output:

Tue MONTH 29 10:56:08 EST YEAR:INFO:Hello again Mike!

3. Code Templates

ReadyAPI 2.5 adds rudimentary support for configurable code templates which will be activated when typing the correspondig template ID and pressing Ctrl-Space in an editor. Templates can be added/changed in the Preferences\Code Templates page, the following templates are available by default:

  • grut - def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )\n|
  • xhre - def holder = groovyUtils.getXmlHolder( "|#Response" )

The '|' designates the position of the caret after inserting the template.

4. JavaScript support

SoapUI 3.0 adds support for JavaScript as an alternative scripting language. When configured, all scripts in the containing project will be interpreted using a JavaScript engine (Rhino) instead (read more about the Rhino engine and supported features at ... ). For those of you used to JavaScript this might be an easier language to get started with.

scripting-project

A note on the choice of Groovy:

When we started to provide scripting possibilities in 2006, Groovy was the natural language of choice. Now this has changed and there are many viable alternatives to Groovy scripting API (JRuby, Jython, Javascript, etc), but since we have made our own optimizations for the Groovy ClassLoaders which would not be available for these other languages, we have opted to stick to Groovy instead of providing "sub-optimal" support for other languages.

男人更年期吃什么药 养胃吃什么好 地蛋是什么 老婆子是什么意思 出国旅游需要什么手续和证件
为什么直系亲属不能输血 木耳有什么功效与作用 灰指甲挂什么科室 儿童尿频什么原因引起的 牙周病是什么
吃什么催奶 珍珠疹是什么原因引起的 什么药补血最快 澳门使用什么货币 哥子是什么意思
牛肉不能和什么水果一起吃 8月开什么花 西地那非是什么 口腔溃疡喝什么饮料 什么街道
梦见手机屏幕摔碎了是什么意思fenrenren.com 脚上长鸡眼是什么原因hcv9jop5ns1r.cn 迁移是什么意思hcv7jop9ns3r.cn 花生有什么营养hcv9jop8ns2r.cn 肾不好挂什么科hcv8jop4ns2r.cn
斑鸠和鸽子有什么区别hcv9jop2ns9r.cn 孕早期头晕是什么原因hcv8jop5ns5r.cn 中暑喝什么hcv9jop6ns7r.cn 好奇害死猫是什么意思hcv9jop1ns5r.cn 鸡的祖先是什么hcv7jop9ns1r.cn
家人们是什么意思aiwuzhiyu.com 熊猫为什么有黑眼圈cl108k.com 出什么什么什么hcv7jop7ns0r.cn 被螨虫咬了非常痒用什么药膏好hcv7jop9ns0r.cn 伤口化脓用什么药xianpinbao.com
湿气重是什么意思hcv9jop1ns5r.cn 口干口苦是什么原因hcv9jop3ns8r.cn 怎么是什么意思hcv8jop6ns7r.cn 什么破壁机好用weuuu.com 1217是什么星座hcv9jop5ns7r.cn
百度