Testing the.NET Message Sample SilkPerformer 2009.

Post on 24-Jan-2016

217 views 0 download

Tags:

Transcript of Testing the.NET Message Sample SilkPerformer 2009.

Testing the .NET Message Sample

SilkPerformer 2009

2 04/21/23

Overview

This tutorial examines the following testing scenarios:

Hooking a Win32 client application

Recording a Web client application

Using .NET Explorer to test a Web Service

Creating a .NET test driver using the SilkPerformer .NET Framework

To begin, launch the Message server.

3 04/21/23

Hooking a Win32 Client (1)

Create a new SilkPerformer WebServices/XML/SOAP project.Add a new application profile for MessageWin32Client.exe.

4 04/21/23

Hooking a Win32 Client (2)

Begin recording. Perform actions in the Win32Client (e.g., connect, login,

send, and logout). End recording. Review the recorded script. For each call made in the

Win32 client application there are WebUrlPostBin calls and a SOAP-Envelope.

Execute a TryScript run (watch the server console window).

5 04/21/23

Recording a Web Client

Create a new Web project. Begin recording:

http://localhost/MessageWebClient/Default.aspx. Execute a TryScript run using the recorded script

(watch the server console window).

6 04/21/23

Testing the Web Service with .NET Explorer (1)

Launch .NET Explorer. Load the WSDL from:

http://localhost/MessageWebService/MessageService.asmx?WSDL Define a scenario such as the following:

Login (User1, Pass1) SendMessage (User2, Some message text) Logout Login (User2, Pass2) GetMessageCount : store result in variable mMsgCount GetMessage (mMsgCount) Logout

This scenario is stored in NetExplorer TestingWebService\TestWS.nef, which can be opened using .NET Explorer.

7 04/21/23

.NET Explorer (2)

Create a new project after launching .NET Explorer.

8 04/21/23

.NET Explorer (3)

Load the WSDL from the Web Service:http://localhost/MessageWebService/MessageService.asmx?WSDL

9 04/21/23

.NET Explorer (4)

Invoke the login method using User1 and Pass1 as input values. You can also use random variables or global variables mapped to attributes

(see the .NET Explorer User Guide for details).

10 04/21/23

.NET Explorer (5)

Send a message that includes some message text to User2 .

11 04/21/23

.NET Explorer (6)

Logout the current user and login as User2 (Username: User2, Password: Pass2).

12 04/21/23

.NET Explorer (7)

Invoke GetMessageCount and store the result in a variable called mCount.

13 04/21/23

.NET Explorer (8)

Call GetMessage with the message count variable as input (you will receive the last message that was sent)

14 04/21/23

.NET Explorer (9)

Add the remaining logout method call. Execute an Animated Run.

The failed verification can be ignored (or you can remove the default verification of the GetMessageCount call).

15 04/21/23

.NET Explorer (10)

Export a SilkPerformer .NET project or a Visual Studio .NET project (exported projects can be found in the following folder:NetExplorerExportedProject). Execute a TryScript Run via SilkPerformer or Visual Studio .NET. Explore the TrueLog. You will see a node for each Web Service call.

16 04/21/23

.NET Framework Project

Create a new .NET Framework project. Use the Model Script dialog to bring up Visual Studio .NET. Code your .NET test driver. A sample implementation of a test driver that tests the .NET

Remoting server and the Web Service can be found in the SPVNetTestDriver folder. Open the project in Visual Studio .NET and execute a TryScript. After the run, review the TrueLog and open the user‘s .wrt file. The sample sends a message from User1 to User2 (where User1 is

connected to the remoting server and User2 is connected to the WebService).