Search This Blog

December 31, 2012

TFS 2010 Build Number Format


In TFS 2010, Build Number Format in Build Definition uses date format by default. For example, here is the Build Number Format.

$(BuildDefinitionName)_$(Date:yyyyMMdd)$(Rev:.r)

TestBuild_20121231.1

TestBuild_20121231.2

TestBuild_20121231.3
....

The build number is incremental on Dec 31, 2012

If our project would like to use Major release 2 and Minor Release 1, the following build number format can be used easily.

$(BuildDefinitionName)_2.1.0$(Rev:.r)

ProjectName_2.1.0.1

Projectname_2.1.0.2

Projectname_2.1.0.3


Can we put the following Build Number format? The answer is no because the following screenshot will appear.

$(BuildDefinitionName)_2.1.$(Rev:.r).182.



You can modify the Build Process Template (xaml) to meet your need of Build Number format as well.

December 30, 2012

Date format localization causes the Issue on ArcGIS Rest API


Our project is using Silverlight 5 and ArcGIS Rest API. We are very happy that the product is live in 7 countries now.

Recently our users in some EMEA countries reported the issue saying that they can’t use some important features in their local machines.  This makes me think that it is the localization issue.  Developers always use English Operating system and IE (en-US) to develop the important features. Of course, there is no issue in their local machines. Testers can’t find those localization issues, either. We need to narrow down the issue and see if we can still repro them. 

It makes me think of some scenarios:

IE French (fr-FR): causes the issue when testing

IE Germany (de-DE):  no issue when testing





Change system Locale to French or Germany and use IE (en-US): No issue when testing.




Change date format to French and use IE (en-US): causes the issue when testing.

Change date format to German and use IE (en-US):  causes the issue when testing.

Change date format to Chinese (PRC) and use IE (en-US): causes the issue when testing in another feature.




Since our product is live in 7 countries, we need to narrow down the issue and finally we find date format in localization causes the issue all the time for some important features. It is easy for our developers to fix the bugs quickly.

We also notice that ArcGIS Rest API can’t handle localization of date format in some EMEA countries very well. In this case, it is out of our control. We need to report the bugs to ESRI.

The quick workaround is to ask users to change the date format to English (United States), it will work.

December 28, 2012

Successfully upgrade Windows 8 to Windows 7 on HP Pavilion G7-2240US and fix the issue of Windows cannot be installed on this disk. The selected disk is of the GPT partition style

My wife got the new HP Windows 8 laptop (HP Pavilion G7-2240US) last week. After she played around it, she didn't like Windows 8 because there was no productivity in her daily job tasks. I totally agreed. 

I don't understand why Microsoft removes the function of disabling Metro UI in Windows 8 RTM, but it was allowed in Windows Developer Preview Version. I have no complaints about Windows RTM in Tablets or Surface Computers. I do have complaints about there is no Windows 8 desktop version for laptop like Windows 7.

She wanted me to "upgrade" Windows 8 (Consumer version) to Windows 7 in this new HP laptop. Here are my steps:

Use F10 key to go to BIOS setup. It has the function called Legacy support. We need to enable it and it can let us install Windows 7.  EFI BIOS will be disabled automatically.

Use Internal CD ROM to boot Windows 7 CD

When installing Windows 7 x64, the setup screen told me to install Windows 7 in a new partition disk. However, I got the error dialog box saying Windows cannot be installed on this disk. The selected disk is of the GPT partition style.

Don’t panic.  Use Shift + F10 and it goes to command prompt.

Enter the following command

diskpart

List disk

Select disk 1

Select partition 1

Clean

Convert mbr :

If I didn’t use clean command, I could not convert GPT to MBR successfully.

After using clean command, I converted GPT to MBR successfully. After rebooting the machine, I installed Windows 7 without any issue.

If you don’t like Windows 8 on your new laptop, you can try to "upgrade" it to Windows 7 and meet your needs. 

December 27, 2012

Test List Editor of VSTS 2010 is deprecated in VSTS 2012


In Visual Studio 2005/2008/2010, we can drag the selected tests from the Test List Editor into the test list. This is a good feature, but it is deprecated in VSTS 2012. The new feature is called Test Explorer.

If you have 1,500+ unit tests in Test List Editor  in VSTS 2010, it is not easy to upgrade those tests in VSTS 2012 because it is deprecated. 

Do you think Test Explorer is user friendly compared to Test List Editor? 

December 20, 2012

TFS Build: When Automated Tests Fail, TFS Build Fails


Yesterday I saw one guy asking one interesting question in MSDN forum. The question can be extended: If automated tests (unit tests, web tests, DB tests, WCF tests…) via MSTEST fail in TFS build, TFS build needs to fail.  It is easy to configure in the TFS build definition:

Open TFS build definition

In Process tab, expand Automated Test

Set Fail Build On Test Failure = True (False by default)





When you queue a new build, TFS build fails as long as one test fails .

In TFS Build definition, I like to Build 2 projects with default platforms and configurations. One is to build Developer project and the other one is to build TEST project.

If TFS can build 2 projects successfully and then run my automated tests, sometimes tests fail due to the code change (service change, DB change) and you are not aware of it. In this case, you can’t make TFS build fail because you need to modify your automated tests.

Therefore, I don’t encourage people to Set Fail Build On Test Failure = True.

If TFS can’t build Developer or TEST project successfully, TFS build fails.

If TFS can build Developer or TEST project successfully, and some automated tests fail, TFS will show Build partially succeeded.

In this case, you can investigate the issue and log the bug or modify your automated tests if required.

December 18, 2012

Fix the issue- TFS Could not connect to Outlook


Today, when I opened Visual Studio 2010 Ultimate to connect to TFS 2010, I would like to send a bug to my manager via Select Selection to Microsoft Outlook. I got the following error message.

TFS242402: Could not start or connect to Outlook. This problem can occur if Visual studio is running full administrator access and outlook is not. If Visual Studio is running with full administer access, close outlook, and reopen Outlook using the Run As Administrator option.





Therefore I have one thing in my mind.  Let me try the following scenario and I get the interesting result.

VS 2010 (No admin right) & Outlook (no admin right)

If MS outlook is open already and choose Select Selection to Microsoft Outlook in TFS, the bug template is in the Outlook.  I can connect to Outlook

VS 2010 (admin right) & Outlook (admin right)
If MS outlook is open already and choose Select Selection to Microsoft Outlook in TFS, the bug template is in the Outlook.  I can connect to Outlook

VS 2010 (admin right) & Outlook (no admin right)

If MS outlook is close and choose Select Selection to Microsoft Outlook in TFS, the bug template is in the Outlook.  I can connect to Outlook

If MS outlook is open already, choose Select Selection to Microsoft Outlook in TFS, I get the error message above.

VS 2010 (No admin right) & Outlook (admin right)

If MS outlook is open already, choose Select Selection to Microsoft Outlook in TFS, I get another error message –Another version of Outlook is currently running. Close it and try again.



My outlook is still the same. Why says another version of Outlook is currently running?  That really confuses people.

Next time if you have this interesting issue, please make sure you use the same right in MS Outlook and Visual Studio. The issue will be resolved.

December 17, 2012

Simple Solution- force browsers to reload Silverlight .xap in user's machine for the specific Production Release


I wrote the post on July 17, 2012 entitled Silverlight .xap needs to be updated in the users’ laptops after pushing a new build. But recently we noticed that .xap file is not updated in user’s machines after we push new change to Production.

The quick workaround for them is to clear the caches in their local machines and hitting the site again will download the latest .xap and .zip files. However, it is not user-friendly.

That being said, we need to force browsers to reload Silverlight .xap in user's machine after we push to Production. Silverlight .xap versioning seems a good idea. 

Actually, I have one simple solution: using different .xap name for the specific Production release. For example, if we have the 12/17 release, we can use XXX1217.xap as the naming convention.

When I use TFS to merge the code from DEV Branch to TEST branch, I can modify the following settings for our Jan 10 release, 2013.

Default.aspx:

Before- param name="source" value="ClientBin/Sprint2.xap"

After - param name="source" value="ClientBin/SprintJan10.xap"

Unload Project and Edit Project file.

Before – XapFilename>Sprint2.xap

After -   XapFilename>SprintJan10.xap

In ClientBin folder, I delete Sprint2.xap first.  After building the solution successfully, I can see sprintJan10.xap in ClientBin Folder. After pushing a new TFS build, the build is successful. When I hit Silverlight Application and check the following folder, SprintJan10.xap is really there.

%USERPROFILE%\AppData\Local\Microsoft\Windows\Temporary Internet Files\



Next time if users have the issue, it is really for me to know if they have the specific Silverlight .xap file for our specific release.


December 13, 2012

Fixed TFS 2010 Build Error – The type or namespace name does not exist in the namespace


This morning when I came to the office, I saw many check-ins from developers last night  and TFS build in DEV environment complained about the following error . The build failed.

MainPage.xaml.cs (21917): The type or namespace name 'XmlSerializer' does not exist in the namespace 'System.Xml.Serialization' (are you missing an assembly reference?)




When I used Visual Studio 2010 IDE to open the solution file and build the solution, there was no issue.  Using MSBuild command line to build the solution in my local machine had no issue at all.

When I unloaded Project and edited Project file, I didn’t see the following file (yellow part) in the project file.

<Reference Include="System.Xml.Serialization, Version=5.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
      <HintPath>..\Lib\System.Xml.Serialization.dll</HintPath>   
    </Reference>

After adding it and pushing a new build again, the build succeeded.

November 26, 2012

Fixed the issue of Internal Error in Changeset in TFS 2010


Today I checked in the code to TFS, I got the following error.  My developers also had the same issue.
This error didn’t mean anything to me. Where is CheckForComments.cs? Microsoft should provide more meaningful information.

Internal error in Changeset Comments Policy. Error loading the Changeset Comments Policy policy (The policy assembly 'Microsoft.TeamFoundation.PowerTools.CheckinPolicies.ChangesetComments, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' is not registered.). Installation instructions: To install this policy, follow the instructions in CheckForComments.cs.

After installing TFS powerful tools 2011, this error was gone.

September 4, 2012

Fix the issue- Browser settings prevent scripts from running on this report


Today I added one web test to validate if the report server is running. In my Windows 7 machine, when I hit the URL of report server (SSRS), I saw the report data successfully. When I logged in to Windows Server 2008 and hit the URL, I couldn’t see it due to the following error:

Browser settings prevent scripts from running on this report. To view this report without scripts, click here.

When I added the report URL in trusted sites in Internet Explorer, it is working perfectly. I also need to add it in the build controller.

After that, when I queued a new build in TFS, the web test passed.

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.

July 31, 2012

First Try- TeamCompanion in MS Outlook

I have used Team Foundation Server since 2007. Yesterday I saw a tool called TeamCompanion ( 90 day trial) online. After I installed this software in my local machine, it appeared in my MS outlook. Now I can use it to connect to our team project and create work items easily.


When opening my outlook, I can go to our Project Portal to see the work status. For our business members who don’t have Visual Studio IDE installed and always use MS outlook all the time, this is a great tool for them to create work items (bugs, tasks, user story) easily in their MS outlooks directly.



Every time when I search the work item in my outlook, I need to enter the parameter and run the query again. There is no way for me to create a query and save it in the outlook. It is only saved in team project. This is not good for business members.


If they can support this feature, that would be great.

July 25, 2012

VSTS Web Performance Test: Fix the issue of Request failed: The request was aborted: Could not create SSL/TLS secure channel

Today my colleague told me if I can use VSTS 2010 to automate MicroStrategy 9 BI Web Portal over https protocol because he wants to run BVTs every day.




I tried 2 different ways:

Coded UI Test:

It can be automated without any issue. You need to logout first before you run the test again.

Web Performance Test:

After recording the test, it shows the error: Request failed: The request was aborted: Could not create SSL/TLS secure channel.

After spending some time investigating this issue, I need to add the following source code to let the test pass.

ServicePointManager.Expect100Continue = true;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3; 

In this case, Coded UI Test is the best solution for MicroStrategy 9 BI Web Portal.

July 24, 2012

VSTS 2010: Add Config Transforms is disabled

Today I look at our developer’s Silverlight Project to debug the issue in Test Environment, and "Add Config Transforms" is disabled when I right click on Web.config .



In order to make Add Config Transforms enabled, I need to go to Build -> Configuration Manager->Active Solution Configuration->New and create a new solution configuration.




After that, Add Config Transforms is enabled.



July 12, 2012

How to turn on Temporary Internet Files Folder in Windows 7?


Yesterday I wrote the post about Silverlight .xap needs to be updated in the users’ laptops after pushing a new build. Someone asked me where “Temporary Internet Files” folder is. Good question. It is invisible by default, but you can use the command line to open the folder directly.

Here are the steps:

Click Start.

In Search Program and files, enter Folder and Folder Options appears

Click Folder Options. In View tab, uncheck “Hide Protected Operating Systems (Recommended)”. Click Apply.
























“Temporary Internet Files “Folder will appear.



July 11, 2012

Silverlight .xap needs to be updated in the users’ laptops after pushing a new build

We have pushed so many builds including important bug fixes since July 6. Today our business analysts opened their IE and found out why the bugs were not resolved. I talked to them: Please refresh your IE and make sure if you get the latest .xap file in your laptop.

The interesting part of Silverlight UI is that if users keep their IE open, after we push a new build and they don’t feel that, they can still use the old Silverlight UI. In order to make their individual .xap updated, the best way is to use F12 key to refresh IE, clear browser cache and go to the site again. I showed them how to do it. 

I also talked to them: Please make sure if you can see Silverlight loading progress indicator (1%-100%) every time when you launch IE. This indicates the latest .xap is loaded in your laptop. If not, the .xap might not be updated.













We can also use the following way to see if .xap is updated in our laptop.

Go to %USERPROFILE%\AppData\Local\Microsoft\Windows\Temporary Internet Files\ and you will see sprint2.xap.

Last Modified: It is the time we have the new build (e.g. 7/11/2002 11:24 AM).

Last Accessed and Last Checked: It is the time we access the site (e.g. 7/11/2002 11:43 AM)


 
If your .xap is not updated, please use F12 key to refresh IE, clear browser cache and go to the site again. When Silverlight loading progress indicator appears, everything is working as expected later.

July 3, 2012

System Restore fixes Internet Explorer has stopped responding

Internet Explorer 8 on my work laptop (Windows 7 x64) crashed all the time yesterday when I browsed my Gmail and some sites I visited often. “Internet Explorer has stopped responding” dialog box appeared all the time. I tried the following ways and could not make Internet Explorer 8 work.

Disabling Add-Ons in Internet Explorer 8 didn’t work.

Resetting Internet Explorer 8 didn’t work.

Using sfc /scannow didn’t work.

When looking at the event logs, I saw 2 dlls (mshtml.dll and urlmon.dll) might crash.
  









Using regsvr32 urlmon.dll didn’t work.

Using regsvr32 mshtml.dll didn’t work.

After long investigation, I find our company pushed windows update yesterday and many machines had the issue. After doing system restore, Internet Explorer 8 works perfectly.

June 29, 2012

How to fix the scenario of No tests to execute via MSTEST in TFS build log?


On June 13, 2012, I wrote a post about How to fix the scenario of No tests to execute via MSTEST in TFS Build 2010?  But I forgot to mention another important thing. You might find this post helpful to you if you have the same issue.

On June 12, 2012, I created a test project that contains unit tests and web tests.  In Visual Studio 2010, I created a new test list called BVT and put all of the tests in BVT and then I checked in the code to TFS source control. After I kicked off a new build in TFS, the build succeeded, but all of the tests in BVT never got executed in the build log (No Tests to execute.)

I logged in to the build server and opened the .sln file of my test project. The interesting part was that all of the tests in BVT were not enabled. I needed to manually click refresh in the test list editor to make them enabled. How did I make those tests enabled in BVT Test List without clicking refresh manually? 

After long investigation , I must check in the bin folder and can’t check in the obj folder. This is  very important!  If I put more tests in BVT, I need to check in bin folder again to make those tests changed. 

After I kicked off a new build again, all tests passed in the build log. After logging to the build server again, all tests were enabled in BVT Test List as well.

June 27, 2012

Coded UI tests have the huge limitation for Silverlight Application and cross browser testing

For Silverlight 5 Application, Coded UI test is not supported in Visual Studio 2010, Visual Studio 11 and Visual Studio 2012 RC.
For Silverlight 4 Application in Firefox, Coded UI test is only supported in Firefox 3.5 and 3.6.  For higher version of Firefox, it is not supported.
For Silverlight Application in Chrome, Coded UI test is not supported.
For Silverlight Application in Safari, Silverlight is never supported on Windows platform. It is only supported on Mac OS. However, Coded UI test is not supported for Safari.
 As a SDET, I would like to say this is not good news for Coded UI test because it has the huge limitation for Silverlight Application and cross browser testing.
Telerik Test Studio can handle Silverlight 5 Application in different browser easily.