Archive

Archive for September, 2011

Performance Counters Timeouts and Load Testing with Visual Studio

September 25, 2011 Comments off

If you are getting following error while running load test and wondering why this happens. Here in this blog entry I highlight ways to fix it.

The performance counter category ‘Memory’ cannot be accessed on computer ‘COMPUTER01’ (Timed out trying to read performance counter category ‘Memory’ on computer ‘COMPUTER01’); check that the category and computer names are correct.

Performance Monitor Tool (perfmon)

This is a well known Windows in-build tool for fetching performance data. First try to fetch the required performance counter from specific machine through this tool. You may notice two things here if your machine is a remote machine. If it takes more time (more than 1/2 minutes) to get the performance counters, that will indicate that you need to change timout values for load test configuration. OR if it does not access the counter then there are permissions issue.

Performance Monitor User Permissions

If you are not able to access performance data from perfmon, then you have to correct that first. As same permission level applies to visual studio load test when it tries to fetch performance data. User who is trying to access performance data (locally/remotely) should be part of  ”Performance Monitor Users” and “Performance Log Users”. If there are not much security concerns make the user part of Local “Administrators” group which will ensure full access on the machine.

Sometimes still there may be some issues. In that case just remove the User or the Group of which the User is part of, from “Users” Group of target machine. Which will provide you fully un-restricted access to machine.

Firewall Exceptions

Rarely you may have to do it. Either turn off the local firewall or enable the rules for Performance Logs and Alerts in the Windows Firewall with Advanced Security snap-in.

Load test timeout settings

If permission levels are all fine. But still you are still running into the same issue. That means you have to set load test’s performance counter initialization time out settings. But where to do that? as there is no provision to do it though VS IDE. For that you have to do some manual configurations in load test’s hosting process’s configuration file. Now this configuration file is different for VS 2008 and VS 2010. Following are the details on that.

For Visual Studio 2008, open the file VSTestHost.exe.config in the folder C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE

OR

For Visual Studio 2010, open the file Devenv.exe.config in the folder C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE

AND then add following entries to it. That will solve the timout issue.

<appSettings> 
     <add key=”LoadTestCounterCategoryReadTimeout” value=”60000″/> 
     <add key=”LoadTestCounterCategoryExistsTimeout” value=”60000″/> 
</appSettings>

 

CUITe Framework (Coded UI Test)

September 24, 2011 Comments off

This weekend I came across a new development in VS Coded UI Testing. Called CUITe (Coded UI Test Enhanced). This is a codeplex project. It is a wrapper over visual studio’s coded UI test framework. Following are some very interesting features worth trying. I am sure whole automated functional testing community has faced lot of issues with Coded UI test. Specially with code maintainability and readability. This wrapper has tried to answer these two. So, here are some interesting things about CUITe.

Features:

  • Simple to setup and use. Just install and refer to one dll “CUITe.dll” in your automation project.
  • It keeps UI Object definitions separate from automation code. BIG Relief.
  • Web Automation: Treat table as Table.
  • Web Automation: JavaScript execution support.
  • Support for Custom UI objects.
  • Supports SilverLight and whatever Coded UI Test supports underneath.
Code Abstration:
  •  No more misnomer UI object type names.
  • Common behavior has been moved to base classes.
  • Automation code becomes more readable and maintainable.
Web Object Recorder
This is a very handy tool which is a part of this package. This tool is basically for web UI. It basically provides UI initialization code.

JavaScript support

Interesting feature. Which can be used to handle some tricky situations. For example invoking context menus on web pages which sometimes can not be invoked by mouse click API.

Apart from this CUITe project also promises some more interesting things in near future. For now, it will help to address two very sticky issues:  Maintainability and Readability. I am sure there is still lot to do in this area. But CUITe will be a right step forward.
For downloading setup/code/documentation please visit. http://cuite.codeplex.com/

Visual Studio 2011 : Getting started.

September 24, 2011 Leave a comment

Visual Studio 11 Dev Preview

The next version of Visual Studio and .NET framework contains many new features and enhancements, making job of .NET developer easy.  So why to wait. Just get started.

Debugging an Addin in visual studio

September 20, 2011 1 comment

Following are the steps :

  1. Delete all bin and obj files
  2. Copy paste any snk file where it is required
  3. Set appropriate debug type you want for the project
  4. Right click on addins project , set “addin project” as startup project
  5. Right click on “addins project”, select properties and set as shown in the screen shot below
  6. Set Start external program C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe
  7. Set Command line arguments /resetaddin <addin lib name without extention>
  8. Set working directory C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE
  9. Create folder addins in C:\Users\<user>\Documents\Visual Studio 20101\Addins
  10. Copy paste the addin definition file and set the parameter <Assembly> as <Assembly>Path to AddIn.dll</Assembly>
  11. Make sure that in addin definition file value of <FriendlyName> node should be exactly same as that of addin definition file name.
  12. Run the project in debug mode.

Customize Binaries Output folder in TFS Team Build 2010

September 19, 2011 1 comment

Following are the issues we face due to limitations in default build template. Which require some customization to meet our requirements. The following are the limitations found:

  • The workflow treats a solution as single project
  • The output of building projects in a solution doesn’t follow the same output directory structure when building in visual studio. For instances, web applications output binaries in the Bin folder while ClassLibrary and Windows applications projects output binaries into the Bin\(configuration) folder.
  • In visual studio, binaries are copied to a bin/(configuration) folder where “configuration” is the configuration of the build (e.g. debug, release..etc) whereas the team build outputs all binaries into one folder called Binaries and that folder doesn’t contain sub folders per project
Solution:
Other solution from Jim Lamb

TFS 2010 : How to Videos

September 9, 2011 Leave a comment

MSDN has many videos that show how you can use Visual Studio ALM tools and Team Foundation Server to help your team develop software more successfully. Here is the list of most important ones

TFS 2010 & VS ALM Videos

TFS 2010 : Training Kit

September 9, 2011 Leave a comment

New to TFS 2010? Where to Begin?

Here is the answer to these questions.  Here is a Training Kit, which is designed to help you understand what TFS 2010 can do for your organization and software process.  It applies to all members of the team – developers, testers, business people and of course, managers.

This training kit will give a glimpse of what TFS 2010 is all about. Download your kit here.

Troubleshoot : TFS Build 2010 : Build agent is currently reserved for a build

September 9, 2011 Leave a comment

I configured three build agents on the same machine with same configuration (lets say A1, A2, and A3). I reserved A1 and A2 for some builds say B1 and B2 using build definition process configuration. Everything worked fine till I deleted those builds (B1, B2) as I was experimenting with them. Now once I deleted them, reserved build agents A1, A2 were there but were not doing any thing. For example if I queued 3 builds at a time they were being processed by only A3. So I thought of deleting these build agents. Adding salt to wound I was not able to delete that, showing a dialog with message

---------------------------
Team Foundation Build Configuration
---------------------------
Cannot delete agent 'A3': The build agent A3 cannot be removed from build controller C1 because it is currently reserved for a build.
---------------------------
OK
---------------------------

On my pursuit to solve this issue, I ended up exploring TFS 2010 db for my project collection and here is what I found.

“tbl_BuildAgentReservation” is the table which retails the reservation details.

“tbl_BuildAgent” the refers to PK of  tbl_BuildAgentReservation for reservation ids against build agent entries.

So, these two tables maintains that blocking link. Once you break it, issue is resolved. And I did the same. Following are the queries you can run to break this reservation.

SELECT * FROM tbl_BuildAgent

Locate the build agent in question then note the value of ReservationId and AgentId and Execute the following SQL statements:

DELETE FROM tbl_BuildAgentReservation WHERE ReservationId = [ReservationId]
UPDATE tbl_BuildAgent SET ReservationId = NULL WHERE AgentId = [AgentId].

Courtesy :

http://sleepcanwait.blogspot.com/2010/07/cannot-remove-build-agent-from-build.html

http://www.anujchaudhary.com/2011/06/tfs-2010-unable-to-stop-build.html

 

 

 

Follow

Get every new post delivered to your Inbox.