如何从soapUI xml响应中获取块代码并作为请求体注入?

时间:2017-01-11 23:05:25

标签: java groovy automation soapui

我有一个肥皂ui回应如下。

<Quantity>
<item id="0001" type="donut">
    <name>Cake</name>
    <ppu>0.55</ppu>
    <batters>
        <batter id="1001">Regular</batter>
        <batter id="1002">Chocolate</batter>
        <batter id="1003">Blueberry</batter>
    </batters>
    <topping id="5001">None</topping>
    <topping id="5002">Glazed</topping>
    <topping id="5005">Sugar</topping>
    <topping id="5006">Sprinkles</topping>
    <topping id="5003">Chocolate</topping>
    <topping id="5004">Maple</topping>
</item>
</Quantity>

现在我需要使用soap ui groovy脚本从<batters>...</batters>获取所有数据,并将请求体中的Send替换为其他测试。说我有:

<Total>
<section id="0001" type="donut">
    <name>Cake</name>
    <ppu>0.55</ppu>
    <batters>
        <batter id="3333">Regular</batter>
        <batter id="4444">Chocolate</batter>
        <batter id="5555">Blueberry</batter>
    </batters>
    <topping id="5001">None</topping>
    <topping id="5002">Glazed</topping>
    <topping id="5005">Sugar</topping>
    <topping id="5006">Sprinkles</topping>
    <topping id="5003">Chocolate</topping>
    <topping id="5004">Maple</topping>
</Section>

我想将<batters>...</batters>部分替换为之前的回复。

或者您能告诉我如何在<batters>....</batters>

之间获取块代码

0 个答案:

没有答案