qileilove

          blog已經(jīng)轉(zhuǎn)移至github,大家請?jiān)L問 http://qaseven.github.io/

          SoapUI利用Groovy對response與斷言的處理

           1.對response的處理:(其中Test Request是request的名稱)
          def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )
          def holder = groovyUtils.getXmlHolder( "Test Request#Response" )
          log.info(holder.getNodeValue("http://sessionid"));
          def sessionid = holder.getNodeValue("http://sessionid")
          return sessionid
          <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sam="http://www.soapui.org/sample/">
          <soapenv:Header/>
          <soapenv:Body>
          <sam:logout>
          <sessionid>${SessionId#result}</sessionid>
          </sam:logout>
          </soapenv:Body>
          </soapenv:Envelope>
            2.對斷言的處理:
          def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )
          def holder = groovyUtils.getXmlHolder( "Test Request - logout#Response" )
          def sessioninfo = holder.getNodeValue("http://sessioninfo")
          log.info(sessioninfo)
          assert sessioninfo.equals("OK")

          posted on 2014-09-12 09:30 順其自然EVO 閱讀(1611) 評論(0)  編輯  收藏 所屬分類: 測試學(xué)習(xí)專欄

          <2014年9月>
          31123456
          78910111213
          14151617181920
          21222324252627
          2829301234
          567891011

          導(dǎo)航

          統(tǒng)計(jì)

          常用鏈接

          留言簿(55)

          隨筆分類

          隨筆檔案

          文章分類

          文章檔案

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 漳浦县| 花莲县| 沾化县| 遂川县| 临沂市| 浦东新区| 图们市| 千阳县| 上高县| 张掖市| 固阳县| 县级市| 交城县| 武平县| 大英县| 晋宁县| 潞西市| 改则县| 蒲城县| 汉源县| 加查县| 郁南县| 枣庄市| 婺源县| 鄂托克前旗| 八宿县| 湖北省| 汪清县| 呈贡县| 瑞安市| 谢通门县| 琼海市| 临江市| 哈巴河县| 沁阳市| 乡城县| 贵南县| 阳信县| 府谷县| 东港市| 铜陵市|