29
14
SoapUI Pro
by SMARTBEAR
We should get the conversion rate between Euro and US Dollar when
we send this to the server. The response will be a similar XML docu-
ment, where we will locate an element that contains the answer. It will
look like this:
<soap:Envelope xmlns:soap=”http://schemas.xmlsoap.org/soap/
envelope/” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-in-
stance” xmlns:xsd=”http://www.w3.org/2001/XMLSchema”>
<soap:Body>
<ConversionRateResponse xmlns=”http://www.webser-
viceX.NET/”>
<ConversionRateResult>1.318</ConversionRateRe-
sult>
</ConversionRateResponse>
</soap:Body>
</soap:Envelope>
The element “ConversionRateResult” contains the value 1.318, which
should be interpreted to mean that it will cost you 1.318 US Dollars to
get one Euro. I will add an assertion later that will verify this value. Add-
ing an assertion in this case may be a bit risky, as the exchange rate
between Euro and US Dollar isn’t fixed. But let’s ignore that problem for
now.
Add a test suite
The sample request we made earlier should be included in a test suite
that contains one or more test scenarios. Each scenario should also
contain one or more assertions. We will execute this test suite to do a
functional test of an API.