soapUI - 使用groovy在请求中嵌入XML [英] soapUI - embbed XML in a request using groovy

查看:100
本文介绍了soapUI - 使用groovy在请求中嵌入XML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在soapUI上制作测试用例,在一些步骤中,我将使用REST任务并将XML代码放在较低的窗格中,例如

 <数据列表> 
< data>
3.1416
< / data>
< data>
5.11
< / data>
< / dataList>

但我需要获得响应并将结果保存在XML文本中响应,验证Web服务正在执行正确的操作,然后使用收到的结果发送更多请求。



感谢所有人!

我可以使用属性和Property Transfer来解决这个问题。


  1. Add一个属性到自定义属性选项卡中的TestCase


  2. 添加一个属性传输步骤

    source选择响应的测试步骤在哪里存储结果

    2.2在属性的下拉列表中选择ResponseAsXml


    $ b $ 2.3在文本中的源代码写入XML标签的路径如下:
    / dataList / data

    2.4作为目标选择测试用例其中添加了(1)的自定义属性



    2.5作为目标属性,选择客户的名称




  3. 非常感谢大家为您提示的答案:)
    尽快我有更好的声誉我会张贴一些图片。





    I'm making test cases on soapUI, on some steps I would use a REST quest and put XML code in the lower pane, something like

    <dataList>
        <data>
            3.1416
        </data>
        <data>
           5.11
        </data>
    </dataList>
    

    But I need to get the response and store the results that will be contained inside the XML text of the response, to verify that the web service is executing proper operations and then send more requests using the received results.

    Thanks everyone!

    解决方案

    I could solve this using properties and Property Transfer

    1. Add a property to the TestCase in the Custom Properties tab

    2. Add a property Transfer step

      2.1 As source select the test step with the response where are the results to store

      2.2 In the drop down list of property select ResponseAsXml

      2.3 In text are of the source write the path of the xml tag like: /dataList/data

      2.4 As target select the test case where was added the custom property of (1)

      2.5 As target property select the name of the custom property added.

    Thank you very much to everyone for your prompt answers :) As soon as I have better reputation I'll post some pictures.

    这篇关于soapUI - 使用groovy在请求中嵌入XML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆