DCSIMG
March 2010 - Posts - Eran Ruso
Sign in | Join | Help

March 2010 - Posts

Visual Studio 2010 Coded UI Test User Guide - Create A Simple Coded UI Test

פורסם בתאריך Mar 27 2010, 08:47 PM על ידי Eran Ruso

This post is the Second post out of Four that builds the Visual Studio 2010 Coded UI Test User Guide. See the first post: “Visual Studio 2010 Coded UI Test User Guide - Introduction”

On this post I will show how to create a simple Coded UI Test.

 

The example I will use in this guide created by Microsoft and is called: “IBuySpay”

The example is a web application but we will use its GUI in the Coded UI Test.

A few guide lines before we start:

  1. To create a test you need to have a Test Project
  2. Base every Automated Test on a predefined Test Case
  3. Every step in the Test Case will be a Method in the Coded UI Test

Note: In this example I will not show the Test Case.

Creating a Test Project

 

Step 1: Right click the Solution choose: Add –> New Project…

Step_1_Create_project

Step 2: Choose Test from the Menu, in my example it will be a C# Test Project

Step 3: Choose the location and the name of the test project and choose Create

Step_2_add_Test_Project

The result is the test project (DemoIBuySpyTest) and 3 more solution items that are added in case this is the first test project.

These 3 files are out of the scope of this guide.

Step_3_Result

Creating a Coded UI Test

Step 1: Right click the Test Project choose Add –> New Test…

Step_4_Add_new_test

Step 2: Choose Coded UI Test

Step 3: Type a Test name and click OK

Step_5_Add_new_Coded_Test

Step 4: In the window that pops up choose the first option: “Record actions, edit UI map or add assertions”

Step 5: Click OK

Step_6_Choose_record

The Recorder launches.

The Recorder has 4 buttons (From left to right):

  1. Record – Will record actions
  2. Show Recorder Steps – Shows what was recorder and lets the user edit the steps
  3. Add Assertion – Lets the user choose objects and to get there “Passport”, it also lets the user add validation to objects
  4. Generate Code – Lets the user create code out of the recorder actions

Step_7_recorder

Step 6: launch the Internet Explorer Browser

Step_8_Launch_IE

Step 7: Click Record

Step_9_Click_Record

The icon will be changed to Pause

Step_10_recording

Step 8: Type the URL of the tested site

 Step_11__Launch_the_application

Following the guide lines we need to create a method for each step in the Test Case

Step 9: Click the Pause button

 Step_12_Pause

Step 10: Click the “Show Recorder Steps” in order to see and edit the recorder steps

 Step_13_see_recorded_actions

You can see that there is only one recorded steps, in order to edit the recorded steps (If needed) choose the step and click the Delete button in your keyboard.

 Step_14_see_recorded_actions

Step 11: Click the “Generate Code”

 Step_15_generate_method

Step 12: Type the name of the method

Step 13: Click the “Add and Generate” button

 Step_16_Generate

The result is the code generated in the “DemoCodedUITest.cs” TestMethod and new files created, these files have the UI objects mapping.

You can also see the Method we have created.

 Step_17_Result_files

 Step_18_Result_Test_Method

I have created a few more methods that represent a few more steps.

 Step_19_add_more_methods

In order to run the test you can right click the Coded UI Test name and choose “Run Tests”.

Step_20_Run_Test

We have created a simple Coded UI Test, next on this guide we will see we will see how to reuse a prerecorded Coded UI Test in the MTLM tool.

Next Guide Part: "Visual Studio 2010 Coded UI Test User Guide - Get A Coded UI Test Created In Manual Test Using The MTM Tool"

Have Fun!!!

How To Use Team Explorer 2005 With TFS 2010

פורסם בתאריך Mar 25 2010, 07:24 AM על ידי Eran Ruso

I know some of you are waiting for it and now it is finally here: The Team Explorer 2005 extensibility patch for TFS 2010.

Download it from the following URL:

http://www.microsoft.com/downloads/details.aspx?FamilyID=22215e4c-af6f-4e2f-96df-20e94d762689&displaylang=en

I think that the connection to the server user experience will be the same as the Visual Studio 2008 user experience.

Refer to my post: “How To Connect To The TFS 2010 With Team Explorer 2008” for how to connect.

I did not test it, simply because I don’t use Visual Studio 2005 any more so if someone tried it and can share his experience please comment to this post.

Have Fun!!!

How To Investigate Existing Code Using The Visual Studio 2010 Architect Tools

פורסם בתאריך Mar 19 2010, 12:06 AM על ידי Eran Ruso

How many times you have spent hours on code just to understand what it does?

How many of these times it was your own code?

From my experience the answer to both of these questions is A LOT!

In Visual Studio 2010 we can find a set of tools that can help us understand the code a lot faster.

On This post I will show some of the abilities we get with the Visual Studio 2010 Architect Tools when investigating an existing code.

Note: The Architect Tools is in the Visual Studio Ultimate Edition only.

Lets start with ways to investigate an existing code, for that I will use a common solution called “TailSpinToys”.

Step 1: Go to the “Architect” menu item on the main menu

Step 2: Choose “Generate Dependency Graph”

Step 3: Choose “By Assembly”

Step_1__Dependency_graph_by_assembly

What we get is an Assemblies graph that shows all the dependencies between the Assemblies in our solution and two more very important groups:

  • Generics
  • Externals

The thickness of the links shows how strong is the link between the assemblies.

Step_2__Dependancy_Graph_by_Assembly

Lets continue and play with it a little, I will extract the Generics group.

Its little hard to see but what we get is all the generics that we use in our solution

Step_3__etract_Generics

I will now extract the Externals group.

You can see here all the references that we use in the solution.

Step_4__Extract_Externals

I will now extend the System.dll

You can now see all the workspaces in the System.dll, these are not all the workspaces that exist but only the workspaces that are used.

Step_5__Extract_System_DLL

You can continue to dig in and see all the methods that are in the classes that are in the namespaces.

That is nice, but what if I like to be more specific in my Graph creation?

The answer to this need comes from the Architecture Explorer:

Step_10_Architecture_Explorer

Here you can choose what to investigate and set the scope for the graph.

Step_11_First_View

In my example I have done the following steps:

Step 1: Choose “Solution View”

Step 2: Click the filter to see only the “Projects”

Step_12__Clicking_on_Solution

Step_13__Choose_Project

You can see that the view is filtered by a Filter Icon.

 Step_14__Result

Step 5: Choose the Projects that are shown in the screenshot

Step 6: Click the “Files” bar and choose “References”

By choosing References you will see only the reference files

Step_15__Choose_projects

Step_16_Referances

Step 7: Filter by Project

Step_17_Filter_to_projects

Step_18_Filter

Step 8: Choose all and click the Generate a Graph button on the left

Step_19_choose_all

 Step_20_The_result

There are many more options in the architect tools that I will cover in future posts.

Have Fun!!!

How Do I Manage Documents In Team System? (SharePoint)

פורסם בתאריך Mar 05 2010, 04:50 PM על ידי Eran Ruso

I have been asked that question almost in each project I am doing.

The answer is very simple: with SharePoint.

When I give this answer I get a curious look, and the following question will be: “Why?”

SharePoint is a huge product that does many wonderful things, in this post I like to show how it can help us manage our documents.

First thing that you will need to know is that when you create a Team Project you also create a SharePoint site, actually what you create is Windows SharePoint Services (WSS) site which is a free edition of SharePoint.

In each site you have a Documents Section that contains Document Libraries.

From the Team Explorer you have an interface to the Documents Section I will show how to use it in one of my future posts.

Documents_Interface

So how do I get to the site?

In order to get to the site you can just right click the Team Project and choose: “Show Project Portal…”, you can also get to it using its URL.

Step_1__Get_to_site

In the sites menu you will see the Documents Section, Click on it to get to the Documents Section.

Step_2_Get_to_documents_section

Now you will get to the Document Section:

Step_4__Documents_Section

You can do the following and more in SharePoint:

  • Create new Libraries
  • Manage Security for libraries
  • Manage Versioning for libraries
  • Manage folders and documents in each library
  • Upload documents
  • Set template document for each library
  • View history of each document
  • Check-Out and Check-in documents
  • Set Work space
  • Alert On Changes
  • Compare different versions of word documents

In this post I will show how you compare different versions of word documents.

I will start with creating the prerequisites for the example, uploading a document and creating versions for it:

Step 1: I have created a new Document Library called “Demo Doc”

Step_5_create_a_demo_doc_library

Step 2: I have uploaded a document by clicking the “Upload”, browsed to it and checked it in as shown in the following pictures

Step_6_upload_file

Step_7_add_file

Step_8_checlk_in

Step 3: I have created history versions for the document

step_9_view_history

Step_10_history

You can see that there are 3 versions 2 major versions (0.1 is a major version because it it starts from 0) and one minor version 0.2, now I will compare the latest version with version 0.2 and I will see what was changed.

Now we will make the documents comparison:

Step 1: Open the word document using word.

Step 2: Choose the “Review” tab.

Step 3: Open the “Compare” menu and choose “Specific Version…”

step_11_compare_versions

Step 4: Choose version 0.2

step_13_compare_to_

In the result page you can see the changes made since the chosen version up to the current version.

It is easy to see that only one line was added since the chosen version (Marked in Red), on the left hand you can see the details of each change and on the right hand you can see a version with the change (Current) and with out the change.

Step_14_the_result_for_the_compare

You can see that it is easy to compare between two different versions of a document, SharePoint gives a very strong tools that will satisfy all you need for documents management.

Have Fun!!!

How To Get To The Web Access In TFS 2010

פורסם בתאריך Mar 02 2010, 12:26 PM על ידי Eran Ruso

In TFS 2008 the Web Access was a different installation and it came as a Power Tool to the TFS.

In TFS 2010 the Web Access is installed automatically and is part of the TFS.

In order to get to the Web Access in TFS 2010 do the following:

In your preferred browser type:

http://[YourServerName]:8080/tfs/web/

YourServerName is the tfs name for example: http://tfs-srv:8080/tfs/web/

Or you can get to it from the Team Project SharePoint Site:

Web_Access 

Have Fun!!!