WebService is often used in some integrated systems.WebServices often support this system as the bottom layer. ThereforeTestIs abnormal. The following briefly describes some of my personal opinions on WebService functional testing.
I. Case Design and Development
Before case design and development, we need to make some brief analysis on the methods contained in WebService. Mainly from the following aspects:
(1) methods that may need to be manually tested using tools.
(2) which methods can be automatically tested using tools.
(3) which methods can constitute a business scenario. For example, the ticket booking and Unsubscription methods.
(4) Methods used to construct initialization data for business scenarios.
(5) which methods are frequently used in the development process need to be tested.
(6) analyze each method to see whether the results returned after they are called can be directly found or need to be calledOthersMethod.
(7) divide the scenario based on the difficulty of implementation of the method.
(8) Verification Method After method call.
(9) whether the interface has an enumeration type.
Of course, the above is just a reference. If you consider a lot in the early stage, the more favorable it will be for subsequent tests. In many cases, whether the Interface Test is sufficient depends on the preparation in the early stage.WorkInstead of subsequent testing.
After a detailed analysis of the interface, we can often come up with these things:
(1) scenario set formed by interfaces
(2) interfaces that can be manually tested using tools
(3) interfaces that can be automatically tested using tools
Now we can design test cases based on our analysis results. The interfaces used in scenario sets must take into account the repeated use of test data and data transmission between interfaces. interfaces that can be manually tested using tools are often relatively simple, however, data construction and verification results are often troublesome. Therefore, during case design and development, you must write the initialization data construction and result verification steps in detail. You can use an interface automatically tested by tools, considering the construction and recovery of initialization data, the design idea should be based on simple input data (data-driven ).
Why do you use tools for manual testing and automatic testing. Because the tool used by the former is simple, but you need to manually enter the parameters of each method, you can only execute one use case at a time. The latter, only bindDatabaseOr data tables. I will be able to understand the testing tool later.
Ii. Selection of Test Tools
There are a lot of tools on the Internet to introduce WebService Function Testing. Here I will only make some supplements. If you are interested, you can view the relevant information.
(1) WebService Studio
ThisMicrosoftIt is very easy to use. However, the fatal disadvantage is that data cannot be driven, that is, use cases cannot be bundled. However, manual testing requires a sufficient timestamp. Note: When you use this tool to test a method, if one of the parameters requires a null value, you cannot leave it empty, you need to select true for the isnull attribute of this parameter in the tool. Otherwise, different results may appear.
(2) soatest
This tool should be very good and has powerful functions. You can use javascrip to expand its functions. Data can be bundled and managed together with several methods in the tool (that is,TestSuit ). Soatest is excellent in both script management, data bundling, and result display, but it also has some defects. For example, if a method contains enumeration parameters, you must write a complex script to scale it out. Otherwise, you cannot directly bind the enumerated parameter test data.
(3)Qtp
Now let's talk about qtp testing WebService. First, we need to use the qtp WebService plug-in. In fact, this is not necessary. For details, refer to my previous article.Article(Vbs test webservcie ). The script uses vbs to test webservcie, rather than the qtp extension plug-in.
Of course, as an alternative method, the qtp WebService plug-in can still be considered. In fact, qtp uses the WebService plug-in to record few WebService scripts. The most important thing is that XML checkpoints can be automatically generated to reduce the trouble of bundling data.
Iii. Automated implementation after WebService testing is completed
In fact, the script after the Interface Test is completed will be very good for our system integration. We can use these Interface scripts to construct our initialization data, laying a solid foundation for System Automation implementation.