Test user-initiated operations involving Project Professional (Project Server 2010)

 

Applies to: Project Server 2010, Project Professional 2010

Topic Last Modified: 2011-08-05

This article is about operations involving Microsoft Project Professional as the main user interface. The most frequent operations belonging to this category include the following:

  • Open a project

  • Save a project

  • Publish a project

Microsoft Project Server 2010 does not support multiple instances executing in the same user session. Therefore, in order to test many concurrent users, the use of Terminal Services is required unless you have dozens of servers. On the other end, the Visual Studio 2008 Test Agent cannot be instantiated in multiple sessions on the same user session. This would make it quite difficult to integrate Project Professional tests in Visual Studio Team System 2008 Test Edition. However a community-based tool capable of automating Project Professional tests inside multiple Terminal Services sessions has been developed and is available at Microsoft Project 2010: Project Server Stress Testing (https://go.microsoft.com/fwlink/p/?LinkId=190625) in the MSDN Code Gallery. The Thick Client Test Framework tool implements a controller-agent architecture that is conceptually similar to the Visual Studio 2008 Test Edition architecture. In all, the controller pushes information on a SQL Server database, while agents pull job information and update status information regarding their jobs from the same database. Every job is composed of one or more operations, implemented by using custom .NET components and taking advantage of the Project Professional client object model.

The three Project Professional tests described in the following paragraphs are implemented by using the Test Framework tool. Data collection is still performed with Visual Studio Team System 2008 Test Edition running at the same time.

Access the Project Web App home page

You can use the Web Test Recorder tool available with Visual Studio 2008 to record all the HTTP requests occurring when a user accesses the PWA home page. Once you have recorded the Web test, set up the credentials in order to simulate different users in the load scenario. Then let Visual Studio randomly select a user from a list for every test run. You can bind user credentials to a data source, which can read data from a database, an XML or CSV file, or any other data source that is convenient for you. As an example, you can use the Resources.xml file described above as the data source for user credentials. The same approach can be used for all the other tests as well.

Open projects

The sample code included in the "Thick Client Test Framework" in the "Project Server 2010 Stress Testing" solution shows how the opening of a project from Microsoft Project Professional can be automated. The code is dynamically loaded and run by the Test Framework agent. The Open function gets two parameters in input. The first parameter is the file name of the project to be opened. (Using '*' as the file name causes the function to automatically select a Project from the server-side list, in sequence order.) The second parameter is a Boolean to indicate whether the project should be open in read-only or in read-write mode. The function returns the number of milliseconds elapsed for the operation, or zero in case of error. The two parameters can be set through the controller UI.

Save projects

The Resource Center test is very similar to the Project Center test, because it also contains the JavaScript Grid control.

Access the My Tasks page

Microsoft Project Professional only sends the actual changes to the server when it saves. Therefore, in order to perform a meaningful save test you have to apply some changes to an opened project before you save it back. One's imagination is the only limit to what can be done for generating meaningful changes before you save. One simple example is to change the start date of the project, which typically affects all of the tasks in the project, thus generating a significant change set to be saved.

The sample code included in the Test Framework CodePlex solution shows several sample functions, which can be set to be run in sequence by defining a workflow in the controller application. Two examples are as follows:

  1. A ChangeStartDate function, which picks a random date in the [today ± 30 days] range and changes the project start date to the randomly selected date

  2. A Save function, which saves back the active project; the function gets one Boolean parameter as input that can be used to skip the save operation if the active project is opened in read-only mode.

Both of the functions return the number of milliseconds elapsed for the operation, or zero in case of error.

Publish projects

The sample code included in the "Thick Client Test Framework" in the "Project Server 2010 Stress Testing" solution shows how to automate the publishing of a project. The Publish function gets three parameters as input. The first parameter is a Boolean indicating whether the entire project (true) or only the changes (false) will be published. The second parameter indicates the URL for the optional URL for the project workspace to be provisioned. The third parameter is a Boolean indicating whether the publish operation needs to be skipped in case the opened project is in read-only mode. The function returns the number of milliseconds elapsed for the operation, or zero in case of error.

Please send any comments, questions, or concerns about the documentation to epmdocfeedback@microsoft.com.