Search This Blog

August 30, 2012

How to use WinMerge to compare the conflict files in TFS?

I am working on TFS build Automation and I need to merge the branch from Dev environment to Test /Stage environment all the time. If we have the conflict files, I would like to use WinMerge to compare them between the target branch and source branch.

If you have WinMerge installed, it is easy to configure in TFS.

Here is the following configuration:

Open Visual Studio -> Tools-> Options-> Visual Studio Team Foundation Server->Configure User Tools->Add

Extension: .*

Operation: Compare

Command : C:\Program Files (x86)\WinMerge\WinMergeU.exe

Arguments: Command: %1 %2 %6 %7



When I merge from the Source branch (Dev) to the Target Branch (Test or Stage), it is easy for me to compare the conflict files.


August 28, 2012

Microsoft Visual Studio UI Test Plugin for Silverlight 5 is not working.


Microsoft Recently released Microsoft Visual Studio UI Test Plugin for Silverlight to support Silverlight 5. I was very happy to download it to try our current Silverlight 5 Project.

When I used coded UI test to record Silverlight 5 Application, it recorded our login page, but when I clicked some basic features, “the recorded actions have been discarded" appeared all the time.

I would agree with the following saying because it still has a lot of bugs.

It is not an official Microsoft release. We will monitor the Q and A section on this VS Galley site for feedback and queries.

I don’t understand : if this tool is not working well and still has lots of bugs, why release this tool as a joke? I am not going to test this broken tool. 

I gave up this tool and would like to use Telerik Test studio to work on my Silverlight 5 Automation.

August 22, 2012

VSTS 2010 Web Performance Test -Fix the issue of A connection attempt failed because the connected party did not properly respond

Today I used VSTS 2010 web performance test to validate if passing city code to API provided by ARCGIS Online Service can return the expected result. I noticed that running the test was slow and I got the following error

Request failed: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 58.68.148.182:443

I added the following proxy setting.

this.PreAuthenticate = true
this.Proxy = “XXX.XXX.com";
I noticed that running the test was slow and I got the following error.
Request failed: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 10.5.18.19:80

It made me think of the following proxy setting I used before. Finally it works.
  this.PreAuthenticate = true;
  NetworkCredential credential = (NetworkCredential)CredentialCache.DefaultCredentials;
  WebProxy proxy = new WebProxy("Proxy", 8080);
  proxy.Credentials = credential;
  this.WebProxy = proxy;

August 9, 2012

How to validate if the table has the primary key?

In our last Sprint, when I tested in Staging Environment, some basic functions were broken. Per conversation with our developers, they said this table doesn’t have a primary key due to Database Change and ADO.NET Entity Framework needs a primary key in the table.  That’s why it is broken.  Nice Catch!

It made me think of adding some unit tests of validating if each table has the primary key. If I can run those tests after we queue a new TFS build, I will know if it is a good build or not.

How do I validate if each table has the primary key? After doing some research, I can use the following SQL query in my resource file and use C# to run the test.  Everything is working perfectly.


SELECT K.TABLE_NAME, K.COLUMN_NAME, K.CONSTRAINT_NAME
FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS AS C JOIN
INFORMATION_SCHEMA.KEY_COLUMN_USAGE AS K
ON C.TABLE_NAME = K.TABLE_NAME AND C.CONSTRAINT_CATALOG = K.CONSTRAINT_CATALOG AND C.CONSTRAINT_SCHEMA = K.CONSTRAINT_SCHEMA AND C.CONSTRAINT_NAME = K.CONSTRAINT_NAME
WHERE C.CONSTRAINT_TYPE = 'PRIMARY KEY'
and K.TABLE_NAME = 'table name'

August 8, 2012

Coded UI test and Web Performance Test

Here is my thought about Coded UI test and Web Performance Test.


Test Run

Pros
Cons
Coded UI Test
(Client Side)
Launch IE and simulate User Mouse Click Action.




Regression Test/ Functional Test
We can visually see the report /dashboard in IE

It takes time to finish the test run
Load Test:  simulate 100 users in 10 minutes ; the machine will launch 100 IEs in 10 minutes (not good)
Web Performance test (Server side)
Doesn’t need to launch IE and VSTS can capture the screenshot automatically. Very powerful.



Regression Test/ Functional Test
Run the test very quickly.

Load Test:  simulate 100 users in 10 minutes ; the machine will not launch 100 IEs in 10 minutes and easily run the test

Regard report / dashboard as the binary data and in the screenshot; we are not easy to see the dashboard after the tests run.


My Preference

Regression Test (BVTs) : Coded UI Test /Web Performance Test (depend on the situation)

Load Test: add some Web Performance Tests into one Load Test




The product names between VSTS 2010 and VSTS 2008

Last month, my QA manager told me to set up a Visual Studio 2010 Test Environment. But he mentioned the product names of Visual Studio 2008. I felt a little bit confused. After doing some research, I summarize the difference of product names between VSTS 2008 and VSTS 2010. 


VS 2008

VS 2010
VS Team System Test Edition  
VS Team System Suite
VS Ultimate 2010


Visual Studio Team System 2008 Test Load Agent

Visual Studio Load Test Virtual User Pack 2010 
Test Controller

Visual Studio Test Controller  

Visual Studio Test Agent  


Note: Visual Studio Agents 2010 includes Test Controller 2010, Test Agent 2010 and Lab Agent 2010

August 3, 2012

How to search the file name in Temporary Internet Files folder in C#?

Yesterday, I tried to validate one scenario: if users launch Silverlight UI, how much time does it take to download the files (1 xap file and 19 zip files) in their Temporary Internet Files folder?

Temporary Internet Files folder is the virtual folder. The .xap file is not really inside that folder.




From the command prompt, I can know what the file path is for my Sprint2.xap. It has 2 sub folders. Besides, zip files are not in the same sub folder.

..\Microsoft\Windows\Temporary Internet Files\Content.IE5\L0BLXHLN\Sprint2[1].xap (2 sub folders)




In this situation, how do I search the file names in Temporary Internet Files folder in C#?

After doing some research, I can use the following code easily to get any file name I want in Temporary Internet Files folder.

string filePath = Environment.GetFolderPath(Environment.SpecialFolder.InternetCache);

var files = Directory.GetFiles(filePath, "filename*”, SearchOption.AllDirectories); //filename=Sprint2

If I can validate all files are in in Temporary Internet Files, it means I download them from our server successfully.

August 1, 2012

VSTS 2010 Web Performance Test- Currently browser extensions are disabled in Internet Explorer

I have used Visual Studio 2010 Web Performance Test to record many tests on my local machine without any issue. Today when I logged in to another Server (Windows Server 2008 R2, VSTS2010 SP1) in the office and tried to record some web tests, the following error appeared.



Currently browser extensions are disabled in Internet Explorer. This Prevents the Web Test Recorder from starting automatically, and from recording some JavaScript and AJAX requests….

I validated that my browser extensions were enabled and security setting was also working as expected. After some investigation, it was easy for me to record the web test.

Just press alt key and the menu bar appears.

Click View->Explorer Bars->Web Test Recorder 10.0 and you can still record the test.