There is full lists :link

First we take look the Tools related with Visual Studio:

MSTest, the unit test framework in Visual Studio

Coded UI Test

Microsoft Fakes,

Microfoft Test Manager

Visual Studio Memory Profiler

Visual Studio Performance profiler

Visual Studio Load Test, part of VS Ultimate(Testing Performance and Stress Using Visual Studio Web Performance and Load Tests)

TestDriven.Net, unit test running for Visual Studio


Other Test tools I have used:

nUnit,

JetBrains ReSharper UnitTest , 

moq,

SpecFlow




 
Categories: Agile | UnitTest | Visual studio 10/up

Reference:

http://www.codeproject.com/Articles/105497/Automated-UI-tests-with-Watin-in-ASP-NET-MVC

http://blog.willbeattie.net/2011/06/getting-started-with-specflow-watin.html 

My Spectflow feature file

My Step files:
#region Fill fields in form and Submit UserAccountInfo Request

    [Given(@"I on the UserAccountInfo metadata UI test page")]
    public void GivenIOnTheUserAccountInfoMetadataUITestPage()
    {
        CurrentBrowser.GoTo(@"http://localhost:45166/TestWidgetAction?widgetName=BusinessCenterAdminWidgetUser&actionName=UserAccountInfo&returnFormat=HTML");
        CurrentBrowser.WaitForComplete();
    }

    [Given(@"I have entered All fields for UserAccountInfo Metedat UI")]
    public void GivenIHaveEnteredAllFieldsForUserAccountInfoMetedatUI()
    {

        CurrentBrowser.TextField(Find.ById("SessionID")).TypeText(RequestData.SessionID);
        CurrentBrowser.TextField(Find.ById("AccountNumber")).TypeText(RequestData.AccountNumber);
        CurrentBrowser.TextField(Find.ById("AccountContextID")).TypeText(RequestData.AccountContextID);
        CurrentBrowser.TextField(Find.ById("UserID")).TypeText(RequestData.UserID);
        CurrentBrowser.TextField(Find.ById("ConsumerID")).TypeText(RequestData.ConsumerID);
        CurrentBrowser.TextField(Find.ById("TransactionID")).TypeText(RequestData.TransactionID.ToString());
        CurrentBrowser.TextField(Find.ById("OutputType")).TypeText(RequestData.OutputType);
    }

    [When(@"I click submit button for UserAccountInfo Metedat UI")]
    public void WhenIClickSubmitButtonForUserAccountInfoMetedatUI()
    {
        CurrentBrowser.InjectAjaxMonitor();
        CurrentBrowser.Button(Find.ById("btnSubmit")).ClickNoWait();
        
    }

    [Then(@"The Request Url woll displayed in Request section of UserAccountInfo Metedat UI")]
    public void ThenTheRequestUrlWollDisplayedInRequestSectionOfUserAccountInfoMetedatUI()
    {
        CurrentBrowser.WaitForComplete();
        CurrentBrowser.WaitForAjaxRequest();
      var divRequest= CurrentBrowser.Div(Find.ById("divRequest"));
      Assert.IsTrue(((WatiN.Core.Element)(divRequest)).OuterText.Contains("AccountNumber="+RequestData.AccountNumber));//
    }

    [Then(@"The AccountInfo will be loaded in Response Section of UserAccountInfo Metedat UI")]
    public void ThenTheAccountInfoWillBeLoadedInResponseSectionOfUserAccountInfoMetedatUI()
    {
        var divResponse = CurrentBrowser.Div(Find.ById("divOutput"));
        Assert.IsTrue(divResponse.OuterText.Contains(RequestData.AccountNumber));

    }

    #endregion

 

WebBrowserHelper.cs
 [Binding]
    public  class WebBrowserHelper
    {
        public static Browser CurrentBrowser
        {
            get
            {
                if (!ScenarioContext.Current.ContainsKey("browser"))
                {
                    ScenarioContext.Current["browser"] = new IE();
                }
                return (Browser)ScenarioContext.Current["browser"];
            }
        }
        
        [AfterScenario]
        public static void Close()
        {
            if (ScenarioContext.Current.ContainsKey("browser"))
            {
                CurrentBrowser.Close();
            }
        }
    }

My Codes:

 BrowserExtension.cs (1.72 KB) WebBrowserHelper.cs (.85 KB) UserAdminStepHelper.cs (.75 KB) 
UserStoryForMetadataUI_LoadUserAccount.step.cs (5.74 KB) UserStoryForMetadataUI_LoadUserAccount.feature (1.25 KB)
 
Categories: Agile | C# | UnitTest

November 28, 2012
@ 10:59 PM
we are practice BDD by using specflow.

for a web application, when  the user story converted to specflow acceptance test,  it is all for broswer.

Acceptance test for controller is only for developer, not for non-tech business owner/analyst

So I want to use some tool to fill the gap.  After some Google search, I found Coded UI and WatiN could do this job.

Below two articles have a very good example how to do it.

specflow with CodedUI
https://github.com/techtalk/SpecFlow/wiki/Using-SpecFlow-with-CodedUI-API

Specflow with WatiN
blog.willbeattie.net/2011/06/getting-started-with-specflow-watin.html

Ok...which one is better?

 I need to try them and  compare them.

After try both of them,
I think Watin is much better for programmer and much easy to use.
my CodeUI code was broken soon after couple change, and it is very difficult to intigrate with the specflow.

see my other post for my code of specflow and watiN


 
Categories: Agile | C# | UnitTest

Our company haven't Team Foundation Server, to do the integration web test, I plan to extend our existed AppMonitor application to run my .webtest file.  the AppMon just simply call powershell script to send request to the webpage, if it can pick up the webtest, it can do more complicate testing.

To approach that final goal, the first thing is get the classes for the .webtest file deserialization.

below are my steps:
1. rename webtest1.webtest to webtest1.xml
2. in VS command line window, run "xsd webtest1.xml", and you will get webtest1.xsd
3. "xsd webtest1.xsd /classes", you class will be generated.

xsd webtest1.xml
Microsoft (R) Xml Schemas/DataTypes support utility
[Microsoft (R) .NET Framework, Version 4.0.30319.1]
Copyright (C) Microsoft Corporation. All rights reserved.
Writing file 'C:\Users\llj\Documents\Visual Studio 2010\Projects\TestProject1\Te
stProject1\webtest1.xsd'.

xsd webtest1.xsd /classes
Microsoft (R) Xml Schemas/DataTypes support utility
[Microsoft (R) .NET Framework, Version 4.0.30319.1]
Copyright (C) Microsoft Corporation. All rights reserved.
Writing file 'C:\Users\llj\Documents\Visual Studio 2010\Projects\TestProject1\Te
stProject1\webtest1.cs'.



 
Categories: C# | UnitTest


Fiddler2 includes the ability to capture web traffic (including AJAX requests) for later playback with the Visual Studio Web Test product.

Simply run Fiddler and then interact with your Web Application.  When you've finished using your web application, click File > Export Sessions > All Sessions. In the dialog, choose Visual Studio WebTest.


url


 
Categories: UnitTest

Tools--> Manage Add-ons--> Microsoft Corporation-->Microsoft Web Test Record
(and I noticed the Fiddler2 is not enable there either..)




After enable it, You can see the Web Test Recorder bar in the IE window's left.

   


 
Categories: UnitTest | VS 2008

http://weblogs.asp.net/adilakhter/archive/2008/05/04/more-on-unit-testing-testcontext.aspx

What is TestContext?

TestContext is a abstract class of Microsoft.VisualStudio.TestTools.UnitTesting namespace that provides various information about the current test run. Purposes that has been served by TestContext Class -

1.  To store information and provide information to the unit tests during Unit Test Run.

2.  Provide a mechanism to measure performance of your code being tested by the Unit Test.

3.  In Testing the web service it stores the additional information, like server's URL.

4.  In Asp.Net unit tests, it get holds of the Page object.

5.  For Data Driven Unit Tests , it provides access to the data rows.



 
Categories: Agile | C# | UnitTest | VS 2008