16 years ago
How to append a node inside a request for all the test cases in suite?
Hi,
There are a set of xml tags we have in a request like this.
In the above request, field1 and field 2 are mandatory and are present for every request sent for creating/updating the products.
But custom_field1 and custom_field2 are somethings which the admin can define and set up.
These custom fields can be any number.
Now there are some APIs to add , delete , update products. All these APIs have to have these custom fields once defined by admin.But these fields are dynamic, we do not know what and how many custom fields can be generated.
So in the test suite which tests the add, delete and update products, we need to have a common place where this custom fields are stored and they can be inserted dynamically during runtime in each of the test cases.
So initially the request would look like this without any custom fields
Later from some XML the custom fields should be loaded into each of the requests before they are run for all the test cases in the suite.
So the problem is now
1. Whats the best way to store the custom fields XML. Note that the custom fields share a common parent along with other fields. I tried to store in a step with some dummy parent node and giving the assertion as SOAP fault for it. But how can I make use of the request in all test cases?
2:How do I append these nodes to requests in each test case in test suite without having to repeat the step in each test case. The custom fields are common across the test cases.
Any help in this direction is greatly appreciated.
Thanks in advance
There are a set of xml tags we have in a request like this.
In the above request, field1 and field 2 are mandatory and are present for every request sent for creating/updating the products.
But custom_field1 and custom_field2 are somethings which the admin can define and set up.
These custom fields can be any number.
Now there are some APIs to add , delete , update products. All these APIs have to have these custom fields once defined by admin.But these fields are dynamic, we do not know what and how many custom fields can be generated.
So in the test suite which tests the add, delete and update products, we need to have a common place where this custom fields are stored and they can be inserted dynamically during runtime in each of the test cases.
So initially the request would look like this without any custom fields
Later from some XML the custom fields should be loaded into each of the requests before they are run for all the test cases in the suite.
So the problem is now
1. Whats the best way to store the custom fields XML. Note that the custom fields share a common parent along with other fields. I tried to store in a step with some dummy parent node and giving the assertion as SOAP fault for it. But how can I make use of the request in all test cases?
2:How do I append these nodes to requests in each test case in test suite without having to repeat the step in each test case. The custom fields are common across the test cases.
Any help in this direction is greatly appreciated.
Thanks in advance