| Considerations for Working with the Web Services Add-in |
You can use the QuickTest Professional Web Services Add-in to test your Web service using familiar QuickTest functionality, without the need for extensive knowledge of your Web service architecture. For example, you can use QuickTest Professional to invoke the operations of your Web service and verify returned XML data using special functionality that has been customized for Web services. You can use the specialized WebService test object operations to control the way in which QuickTest communicates with your service, including working with security, configuration, headers, and attachments. You can also use the Web Services Add-in together with any other QuickTest add-ins to create tests that test both the direct communications with your Web service and the front-end application that reflects the results of these communications. |
| Understanding the Web Service Testing Wizard |
The Web Service Testing Wizard helps you select the WSDL source, set security options, and specify the Web service, port, and operations you want to test. For tests, you can also choose to automatically insert checkpoints with the proper syntax for each selected operation. When you finish, the wizard creates a WebService test object that represents the Web service and port you want to test and inserts the relevant steps directly into your test or component. You can then update the generated steps of your test or component by replacing the generated argument values with valid values, updating the expected values, and selecting the nodes you want to check in your checkpoints (tests only). After you perform these steps, you can update the data by performing an update run You can also enhance the generated test or component by inserting additional steps or, for tests, adding programming logic.
Note: QuickTest includes Maintenance Run Mode, which is not supported for applications such as Web services, which do not have a user interface.
| ||||||||
The Web Service Testing Wizard includes the following screens:
| ||||||||
Welcome to the Web Service Testing Wizard ScreenThe Welcome to the Web Service Testing Wizard screen is the first screen displayed when you open the wizard. The screen describes the steps in the wizard. You can choose not to display the welcome screen when you open the wizard. Clear the Show Welcome screen when running the wizard check box in this screen, or select the Tools / Options / Web Services node in the QuickTest window and then clear Show Welcome step in Web Service Testing Wizard in the Web Services pane of the Options dialog box. | ||||||||
Web Service Testing Wizard - Specify WSDL for Scanning ScreenThe Specify WSDL for Scanning screen enables you to select the required WSDL source. The source can be a URL, a WSDL file, or an existing WebService test object from the object repository.
Note: The first time you open the Web Service Testing Wizard, the URL box is empty.
On subsequent uses of the wizard,
the Specify WSDL for Scanning screen opens with the same settings as those set in the previous wizard session.By default, the WSDL source is analyzed using the .NET Framework 2.0 WSE 3.0 toolkit. You can change the toolkit if required. | ||||||||
In the Specify WSDL for Scanning screen, specify the WSDL source and whether you want to include security settings in your Web service test, as follows: Select a radio button according to the WSDL source you want to test. Then enter the source. You can click the down arrow next to each box to view and select recently used items. | ||||||||
| ||||||||
Select the Include security settings in the generated Web service test check box if you want to specify the security tokens that are required for communication with the Web service you want to test. | ||||||||
Web Service Testing Wizard - Set Security Options ScreenThe Set Security Options screen enables you to specify the security tokens that are needed for communication with the Web service you want to test. For each selected security token, you also set its property values. After you complete the wizard, QuickTest converts your selections into one or more test steps, containing the corresponding operations and property values. For example, if you select X.509 Token, QuickTest might add steps similar to the following:
tokenID = WebService("FlightNetWebService").Security.AddX509Token( micRequestToken, XMLWarehouse("Certificate") )
Additionally, if you select Client Certificate or X.509 Token in the Security tokens area, the wizard loads the certificate that you specify in the Token properties area and saves it with the test.
The wizard stores the raw data of the certificate as a binary string in a new XML structure. During a run session, QuickTest uses this certificate and does not load it from the external source that you specified.
You can access the certificate from the XML Warehouse pane in the Settings dialog box
| ||||||||
In the Security tokens area, select the check boxes for the security tokens needed for communication with the Web service you want to test. You can highlight any token to view its description in the Description area. When you highlight a token, its properties are displayed in the Token properties area. (Note that highlighting the token does not select its check box.) You can select as many security tokens as needed. The following security tokens are available: | ||||||||
| ||||||||
Web Service Testing Wizard - Select Service and Operations ScreenThe Select Service and Operations screen enables you to select a service and a port from the source WSDL you specified in the Specify WSDL screen. The test object that the wizard generates represents this specific service and port. You can then select the operations to be included in the test or component steps from the list of available operations supported by that Web service. You can also arrange them in the required testing order. From the Service name list and Port name list, select the service and port that you want to test. The name of the service you select is also used as the default name of the created test object. If a description of the Web service is available, it is displayed as a tooltip when the cursor is positioned over the service name. | ||||||||
In the Available Operations list, double-click each operation you want to include, or select an operation and click the right arrow button > to add it to the Selected Operations list. You can add the same operation more than once. To remove an operation from the Selected Operations list, you can double-click it in the Selected Operations list or select the operation and click the left arrow button < | ||||||||
Use the up and down arrows | ||||||||
Web Service Testing Wizard - Summary ScreenThe Web Service Testing Wizard Summary screen provides a summary of the operations for which the wizard will add steps according to your selections. When working with tests, you can automatically insert XML checkpoints by selecting Add XML checkpoint after each relevant step (selected by default). Selecting this check box adds an XML checkpoint for each step in the test that has a return value or an output argument. The WebService test object is stored in the local object repository, and the defined steps are converted to the proper syntax and inserted into your test. |
| WS-I Standards |
Note: QuickTest performs the validation using the WS-I validation tool, which is a third-party application that is not provided with QuickTest.
You can download Interoperability Testing Tools 1.1 from the Web Services Interoperability Organization Web site at
http://www.ws-i.org. Note that it must be installed locally.
| ||||
Download and install the WS-I Testing tool.The Web Services Interoperability Organization (WS-I) is an organization founded to write best practices about the web services interoperability. Its WS-Basic Profile and WS-Basic Security Profile documents deals with some specifications and recommendations to prevent interoperability problems. They provide a toolkit which can be used to check if the services are compliants with the basic profile or not. The WS-I testing toolkit contains two tools:
The tool which will interest us today is the WSDL Analyzer, and its ability to check a WSDL and generate a report about its compliance with the WSI-Basic Profile. The report contains the result of the test, and the uncompliant points if there are.
You can run the validation tool manually in QuickTest, selecting Tools / Validate WSDL
to open the Validate WSDL dialog box. You can also validate that the WSDL source conforms to WS-I standards programmatically using either the
When the validation is complete, you can view the validation results, which indicate whether the file conforms to WS-I profile guidelines. Note that it is possible that your Web service tests or components on the specified WSDL will run successfully even if they do not conform to these guidelines Before you can use the WS-I validation tool, you need to specify the location of the WS-I validation tool. You do this in the Web Services pane of the Options dialog box ( Tools / Options / Web Services node).
Note: When you run the WS-I validation tool, QuickTest accesses the WSDL.
If the WSDL you are validating is located on a secure server, or if the network connection is secure,
you must save the WSDL and any additional resources referenced by the WSDL to a non-secure location (such as a local drive) before running the WS-I validation tool.
in the WS-I Deliverables section of WS-I site
on the left menu, select the Testing Tools option.
in the Testing Tools Filter , select the | ||||
![]() | ||||
Download your requested toolkit ( Java or .NET ) to your hard drive and unzip the file. locate the wsi-test-toolsfolder and copy the folder to a known location. |
| Setting Web Services Test Options |
Before you can use the WS-I validation tool, you need to specify the location of the WS-I validation tool. You do this in the Web Services pane of the Options dialog box. The Web services options enable you to specify the toolkit that QuickTest uses when learning WebService test objects, specify WS-I validation preferences, and set additional display settings for the Web Service Testing Wizard Learn new test objects using the following toolkitSpecifies the toolkit you want QuickTest Professional to use when learning new WebService test objects:
Tip: It is recommended to run Web service tests using the same toolkit with which the test was created.
WS-I validation tool location
WS-I validation tool platformIndicates the Web service client platform type—.NET or Java.WS-I report optionsSpecifies the criteria for the assertion results to be included in the validation report. Test assertions are used by the WS-I validation tool to analyze whether a Web service conforms to WS-I standards. The following options are available.
Note: You can use the WS-I validation tool to test Web service interoperability.
It does this by checking compliance with the WS-I Basic Profile.
The WS-I validation tool, Interoperability Testing Tools 1.1, is a third-party application and is not provided with QuickTest Professional.
Show Welcome screen in Web Service Testing WizardSpecifies whether to display the Welcome screen when you open the Web Service Testing Wizard. You can also control this option by clearing the Show Welcome screen when running the wizard check box in the Welcome screen.Display information message when Web Service Testing Wizard finishes
|
| Check that Your WSDL Meets WS-I Standards |
Before we start testing WS-I Validation we are going to prepare three different wsdl file sources to review all the aspects. Validating WS-I by URL Location
| ||||||
Validating WS-I by File Location
| ||||||
Validating WS-I by Object Repository Location
| ||||||
Report OptionsClick the Report options down arrow and select the criteria for the assertion results to be included in the validation report. (Test assertions are used by the validation tool to analyze whether a Web service conforms to WS-I standards.)
| ||||||
ValidationClick the Validate button to analyze the specified WSDL source and check that it conforms to WS-I standards. The validation is performed for each binding defined in the WSDL. This process might take some time. When the check is complete, the Validate WSDL dialog box expands to display the results of the validation check in the Validation reports area. This area lists the reports generated by the WS-I testing tool and indicates the status of each report. |
| Hands-On: Handling a Single-Simple Return Value |
| ||||||
Since we are testing SOAP requests we are interested to know what is the WSDL location also we can see the Function name ( ConvertTemp ) and the Server Description Before we start with QuickTest Web-Services Wizard we want to understand, what we are going to do. So, we are going to use the Temperature service, with a single operation ConvertTemp the operation will receive 3 parameters : | ||||||
<s:element minOccurs="1" maxOccurs="1" name="Temperature" type="s:double" />
<s:element minOccurs="1" maxOccurs="1" name="FromUnit" type="tns:TemperatureUnit" />
<s:element minOccurs="1" maxOccurs="1" name="ToUnit" type="tns:TemperatureUnit" />
| ||||||
The 1st parameter Temperature of type double( number )
The 2nd parameter FromUnit of type TemperatureUnit
The 3rd parameter ToUnit of type TemperatureUnit | ||||||
| ||||||
The web service returns 1 single argument of type double. | ||||||
<s:element minOccurs="1" maxOccurs="1" name="ConvertTempResult" type="s:double" />
| ||||||
We're moving to QuickTest; Opening the Web Services Wizard in the Specify WSDL for Scanning pane, we select the URL option and type the WSDL Location and then we click on the Next button. | ||||||
![]() | ||||||
In the Select Service and Operation pane we select the ConvertTemperature Service Name and ConvertTemperatureSoap Port Name, and the ConvertTemp available operation. and then we click on the Next button. | ||||||
![]() | ||||||
Finally, we uncheck the Add XML checkpoint... option, since we don't want to implement a checkpoint right now. | ||||||
| ||||||
| ||||||
Since that the WSDL file argument are defined, QuickTest "knows" what are the input options order and values should be.
| ||||||
|
| Hands-On: Handling a Single-Complex Return Value |
The following Web Service is still a simple one, even that for those unfumiliar with XML and XPath Can be complexed. the following web service still returns a single string, but on more complex pattern. In fact, an Xml pattern. | ||||
Let's start by understanding the purpose by watching the wsdl file, and understand the involved arguments. navigate to http://www.webservicex.net Service Global Weather click on the Service Description link. | ||||
<s:element name="GetWeather"> | ||||
The above definitions means that we have a service with to operations.
| ||||
<s:element name="GetWeather"> <s:element minOccurs="0" maxOccurs="1" name="CityName" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="CountryName" type="s:string" />
<s:element name="GetWeatherResponse">
<s:element minOccurs="0" maxOccurs="1" name="GetWeatherResult" type="s:string" />
| ||||
|
The Operation GetWeather recieves two string arguments: The 1st is a string represents a CityName and the 2nd is a string represents a CountryName. The operation returns a single string. | ||||
<s:element name="GetCitiesByCountry"> <s:element minOccurs="0" maxOccurs="1" name="CountryName" type="s:string" />
<s:element name="GetCitiesByCountryResponse">
<s:element minOccurs="0" maxOccurs="1" name="GetCitiesByCountryResult" type="s:string" />
| ||||
|
The Operation GetCitiesByCountry recieves a single string argument: A string represents a CountryName. This operation also returns a single string. | ||||
Hands OnFirst we are activating the Web Services Wizard , or alternativelly from the menu
Automation / Web Service Testing Wizard.. The Web Service Testing Wizard opens.
| ||||
Step 1in the Welcome to the Web Service Testing Wizard Screen just click Next | ||||
Step 2in the Specify WSDL for Scanning Screen select the URL option, and paste the following WSDL location:http://www.webservicex.net/globalweather.asmx?wsdl, uncheck the Include security settings in the generated Web service test option, and click Next | ||||
Step 3in the Select Service and Operations Screen Click on the button to add all Available Operations to Selected Operations list
and then , click Next.
| ||||
Step 4in the Wizard Summary Screen uncheck the add XML checkpoint after each relevant step option and then , click Finish. | ||||
Step 5
| ||||
Step 6
| ||||
|
QuickTest Professional supports keyword-driven testing on your Web services.
This means that after you add a
Note: QuickTest includes Maintenance Run Mode, which is not supported for applications such as Web services, which do not have a user interface.
Tip: From the Attachments of type list in the Browse for WSDL File dialog box
(or Files of type list when choosing a file in the file system), you can choose to view only
.wsdl files, only .xml files, or view all the files in the selected location
to sort the Selected Operations list into the required testing order.


Let's start practicing with a service that return one single value.
navigate to 






, or alternativelly from the menu
button to add all