| Complex Web services |
As we continuing to use more complex web services we are navigating to www.xignite.com For using Xignite you have to be registered to their web site. after registering you can use a service free, for about 100 times. i think is enough to practice this topic. So i selected a service called XigniteMetals a service that provides Real-time Gold and Precious Metal Spot Prices. The Servicehas 15 operations, so i selected an operation that we can fully test GetHistoricalSpotPrice the operation, returns a historical spot price for a metal. | ||
Xignite Web Services
"Xignite is the leading cloud services provider of on-demand, global financial market data and application components.
The Xignite financial Web services and mash-up platform helps companies build smarter websites and software applications in minutes with zero infrastructure investment and cost-effective subscription pricing.
Xignite fulfills more than one billion service requests per month and offers the broadest selection of financial Web services available today with more than 50 solutions covering domestic and global equities, commodities, currencies, fixed income and interest rates, company fundamentals, corporate information and more. Xignite solutions power mission-critical applications for financial websites, portfolio management, sales management, trading, investor relations, executive dashboards, ERP, accounting, e-commerce, and online games for more than 400 global clients, including Forbes.com, kaChing.com, NetSuite, Citi, GE Commercial Finance, ING, Starbucks, Wells Fargo and Wendy's. For more information, please visit Xignite at www.xignite.com or call 1-866-XML-SOAP." Farris Pine Xignite, Financial Web Services | ||
Input ValuesXignite seems a very serious web service provider site, you don't have to understand WSDL structures and rules. Xignite itself provides the requested information, so you can easily understand the purpose, the input values or the return values of any operation and service. following an image from xignite web site, under the XigniteMetals Web Service, operation GetHistoricalSpotPrice | ||
| ||
Output Values8 different values returned from a single request. since that AsOfDate is always in the past the values are not changing and they are testable, as we want to test the service itself. | ||
| ||
Capturing the WSDLon the right menu, of the XigniteMetals service, click on the WSDL option. You can find the WSDL for all the services by adding '?WSDL' at the end of the URL for that service. For instance, the WSDL for XigniteMetals is: http://www.xignite.com/xMetals.asmx?WSDL | ||
| ||
Testing the ServiceSelect from the QuickTest menu Automation / Web service Testing Wizard In the Set Security Options Screen select URL and paste the following wsdl location : http://www.xignite.com/xMetals.asmx?WSDLclick Next In the Select Service and Operations window, select only the GetHistoricalSpotPrice operation using the XigniteMetalsSoap port name. then click Next | ||
| ||
In the Summary Screen check the | ||
|
| Enhancing the Web service Test - Static Data |
After creating a basic test, we want to make improvements. we want to tes more metals, different currencies and different dates. since the specific checkpoint tests past values i will rename it to MetalsPast | ||||||||||||||||||||||
To modify the existing checkpoint select checkpoit properties we select the keyword checkpoint from the keyword view and pressing the Checkpoint button or alternatively, for the Expert view, by selecting the Checkpoint Properties context menu.
| ||||||||||||||||||||||
Parameterizing the XML Checkpoint
| ||||||||||||||||||||||
We are only testing the values of the following fields. since we excluding the administration fields. | ||||||||||||||||||||||
| ||||||||||||||||||||||
before last step, we need to parameterize the input values for the service.
| ||||||||||||||||||||||
| ||||||||||||||||||||||
| ||||||||||||||||||||||
on the last step, we are about to add new valid information.
| ||||||||||||||||||||||
we are running the test in Update Mode, when test finished we are going to see the following results: | ||||||||||||||||||||||
| ||||||||||||||||||||||
And why is exactly the test ended with status warning? | ||||||||||||||||||||||
| ||||||||||||||||||||||
a little more reserch will lead us to the | ||||||||||||||||||||||
Workaroundwe need two types of checkpoints, one for the USD-EUR currency, and the other for the rest. in this case we are going to"duplicate"the checkpoint, and use it differently inside an If...Then clause. | ||||||||||||||||||||||
| ||||||||||||||||||||||
| ||||||||||||||||||||||
Updating expected ResultsBefore we can run the final test,we need to fill the expeced results. according this example and the goal of the test, all we need to do is to analyze the SOAP Response. | ||||||||||||||||||||||
| ||||||||||||||||||||||
Using Formulas in the Data TableOne interesting parameter is the Symbol. The symbol value is always a concatenation between the Type and the CurrencyWe can use Microsoft Excel formulas in the Data Table. This enables you to create contextually relevant data during the run session. it is also possible to use formulas as part of a checkpoint to check that objects created on-the-fly (dynamically generated) or other variable objects in your Web page or application have the values you expect for a given context. When using formulas in a Data Table to compare values (generally in a checkpoint), the values you compare must be of the same type, for example integers, strings, and so forth. | ||||||||||||||||||||||
| ||||||||||||||||||||||
We have finished to design the test, you can run the test now. don't forget to select Run on all rows for the action call propertes. | ||||||||||||||||||||||
|
| Enhancing the Web service Test - Dynamic Data |
Testing Dynamic Data is a different story, unless you can predict each value exactly. So, when testing dynamic we want to test the rersponse structure and pattern values ( e.g numeric, range of values etc. ) | ||||||||||||||||||
| ||||||||||||||||||
|
| Enhancing the Web service Test - Negative Testing |
Terms like "negative test" and "positive test" are more of a concept than a strict activity.
In both instances we are dealing with an input, an action, and an output.
The action acts upon the input to derive a certain output.
Both test cases can produce errors and, in fact, some say that the success of a test case is based upon the probability of it finding new errors in an application.
positive testing is that testing which attempts to show that a given module of an application does what it is supposed to do. | ||
in XigniteMetals web-service, we want to test that invalid information is handled correctly.
for an instance, sending an invalid date, should fail the service and notify the service consumer, by not doing so,
we have a problem. The first thing that comes up in our mind is senf invalid currency type and/or invalid metal symbol.
as soon as you call the service using an invalid metal symbol or/andnot supported ciurrency you'll
get the following exception. | ||
| ||
The toolkit WSE 3.0 raise the exception because the first two parameters are strictly defined by the service, and not handeled by the service provider. the only value we can "play" with is the AsOfDate field. we are going to use a single checkpoint as the following : | ||
| ||
The expected messages ( results ) must not be tested accurately, but approximately enough, using a regular expression. | ||
| ||
|

