Whenever you get a new operation or an existing operation with a changed contract the following process is useful to both familiarise yourself with the operation and to prepare for some serious service testing.
Firstly create an empty project and then add a standard service request generating all operations.
The generate button results in the following:
This produces code like so:
web_service_call
(
"StepName=GetDataUsingDataContract_102",
"SOAPMethod=Service1|WSHttpBinding_IService1|GetDataUsingDataContract",
"ResponseParam=response",
"Service=Service1",
"ExpectedResponse=SoapResult",
BEGIN_ARGUMENTS,
"xml:composite="
"<composite>"
"<BoolValue>true</BoolValue>"
"<StringValue>abcde</StringValue>"
"</composite>",
END_ARGUMENTS,
BEGIN_RESULT,
END_RESULT,
LAST
);
This produces code that isn’t going to work obviously but, that isn’t the point. The first step is to replace the HP supplied values with ones that relevant for the service and the business domain. For example; if a user id is required, the default string should be replaced with a valid id.
The goal is to have a working request.
The next step is to comment out each of the properties in the request that you think are optional. Do this one at a time and rerun the test. Keep doing this until the test fails. Add that property back in and move onto next until you have bare minimum properties required to make a successful request.
What about requirements?
If you get service documentation with your requirements then this is where you should start rather than all properties. Remember though that you are testing the service not blindly following documentation. Often I have found documentation listed mandatory properties that are not so and optional properties are hardly optional.
When you have compiled your bare minimum properties required for making a service request, set them up in your vuser_init as per my instructions on improving service tests and get started on building your test suite.
|
|
Ryan Boucher is a Software Inquisitor and is passionate about it. You can find a whole raft of articles and anecdotes about software testing and other topics he gets excited about. |
| Tags |

