Come let us explore together…


Hi,

I am happy to introduce the recently published “TestComplete Cookbook” and excited because I was one of the technical reviewer of this book.

3585OT_SMALLThis book lists features from TestComplete tool and describes it based on test automation scenarios and common requirements. It has lots of best practices and techniques to learn and will help you to improve your skills on TestComplete. I like the way the author explains to the reader throughout the book in a simple language. After finishing each section, you will better know where and how to apply it in addition to understanding the concepts.

To know more about the book, author or read sample chapters, follow this link http://goo.gl/0aPrgK

Offer:

Along with the publisher, we are pleased to announce that we are organizing a giveaway especially for you. All you need to do is just comment below the post and win a free e-book of TestComplete Cookbook’. Two lucky winners stand a chance to win a copy of the book. Keep reading to find out how you can be one of the Lucky One.

How to Enter?

Simply post your expectations from this book in the comments section below. You could be one of the 2 lucky participants to win the copy.

Deadline:

The contest will close on 23rd January, 2014. Winners will be contacted by email, so be sure to use your real email address when you comment!

Believe!!! There are 101 ways to automate…

Thanks and Regards,
Giri Prasad

Hi All,

Greetings!

We will understand how VS2010 is supporting testing and some internals (which I know at this time) on it.

The feature which helps users to record/code/automate, a desktop/UI controls is called CodedUI in VS2010. CodedUI is built on top of existing unit testing framework of visual studio ie., The new UITesting (Microsoft.VisualStudio.TestTools.UITesting) namespace and its siblings which is supporting UI automation is a sibling of the unit testing namespace (Microsoft.VisualStudio.TestTools.UnitTesting). You can witness this when you create new class using this feature where the arrangement of test classes and methods is similar to that of unit testing with slight attribute differences.

These assemblies and few more are important for developing the test and to interact with the AUT. The assert statements, test attributes and test context will be only available if you include the proper namespace references. But mostly they will be added once you create an item of type coded UI test.

In VS2010 ultimate, when you add ‘Coded UI Test’ to the test project, two items are added namely – UIMap.uitest and CodedUITest1.cs which are basic for the development of test automation.

Briefly UIMap.uitest is the UI object repository or map of the UI objects we interact during our recoding or testing. It has two partial classes (UIMap.Designer.cs and UIMap.cs) to support this. CodedUITest1.cs (default class) is the container to add test methods which in turn calls the test actions. You must understand what each item is capable of and I have provided reference at the end of this post.

You must follow the defined framework approach to arrange your tests. The below diagram depicts the details.

Assembly1 {
          Class A {
                   Test method T1 {  }
                   …
                   Test method Tx {  }
          Class B {
                   Test method T11 {  }
                   …
                   Test method Txx {  }
  …      
          Class C {  }
}

 The test will be referenced as Assembly1.ClassA.TestMethodT1().

Thus you should use suitable test attributes like CodedUITest for a class to denote it as a CodedUI class, TestInitialize to tag a method which is invoked automatically  each time just before the a test method is executed and TestMethod to denote the actual test. These and many other test attributes help us to arrange units like the one mentioned above.

If you want to jump-start, just automate a simple scenario like calculator or a Google page (refer MSDN links given below for steps). Then go to the UI map and CodedUI class files to understand the code. If you have prior experience in other automation tools, then UI map in VS might surprise you.

Because, the UI objects are mapped as XML and their properties (which are used to identify them uniquely) is embedded as raw properties inside a class. Yes. NO good UI/Window to showcase the recorded objects. The entire recording is stored as Classes, methods and properties. If you can apply a patch (VS2010 feature pack 2), the XML object mapping visualized as hierarchy of objects in a windows form.

And a BIG advice from Microsoft is “Don’t edit content of UIMap.Designer.cs” file. Manual updates to this file will be lost when you record a new scenario referring to the exited UI map. Only CodedUI recorder is allowed to modify this content and simply updates thru the tool will be preserved.

For example in Step 1: Record action for searching “Testing” in Google. Generate code and close the test recorder.

Step 2: Go to ‘UIMap.Designer.cs’ and replace the string “Testing” (generated by test recorder) to “Automation” which is stored as parameter.

Step 3: (Go to searched Google result page) Start Test Builder from the previously recorded method (say – CodedUITestMethod1 using the right-click context menu). Add an assertion using the cross hair from the test builder for any of the link from the Google results page. Generate and close the test builder.

Now if you look for the replaced parameter done in Step 2, it will be overwritten by test builder when you performed Step 3.

So, Can’t I modify my recorded scripts?

Yes. We can! Since ‘UIMap.Designer.cs’ and ‘UIMap.cs’ are partial classes, we can do our custom scripting in ‘UIMap.cs’ file. And modify the references accordingly. (I will come with an exercise on how to preserve changes in a separate post)

The UI automation is backed by Microsoft’s MSAA technology and has capability to expand well. The recording is good and intelligent.

Like all other tools it supports data driven testing using few default providers for XML, CSV and SQL tables and reporting.

Above all you have the implicit advantages of coding in VS IDE where you can visualize objects, better debugging and organize tests  – to name a few.

We will continue to explore new areas and dig deep in to interested features in the coming post.

Believe!!! There are 101 ways to automate.

Thanks and Regards,

Giri Prasad

Step by step tutorial to start : http://msdn.microsoft.com/en-us/gg465252


Hi All,

Greetings!

I have been working in VS2010 team system for last couple of months and its time to share and learn along with you.

What VS2010 offers for testing?

Microsoft follows team system approach for team collaboration starting from requirement collection, planning, development and release related activities. Until this version, a major gap exists in their collaboration as they didn’t support functional testing completely (supported unit test only).

In the release of VS2010, it said to landed in testing by providing good support for testing practices and extend all their team system capabilities to testing services as well. I will give credit to Microsoft and their Testing team because they have done it well and supposed to be their first release of supporting testing process.

I am a beginner in VS2010 testing concepts and learning things everyday. I will praise the good things and point out the issues as we move in this exploration.

Microsoft – like every one, bundles different feature for different versions and pricing models. VS2010 Ultimate version is said to have complete set of features of this release where one can develop, write unit, record/develop functional tests(involving UI actions),connect to TFS and with Test Manager to write manual test cases for a test plan, record test actions, run them using lab manager and more. I will be interested on this and most of my posts will be based on this version.

And Believe!!! There are 101 ways to automate.

Thanks & Regards,
Giri Prasad

Hi All,

[This post explains the configuration required for IIS when it is installed/reinstalled after .NET framework installation]

Recently I faced an issue with IIS (Server 2008) in a new VM which is described below with the solution.

I was given a VM and asked to setup the VM for as per my development environment. Initially the VM seems to be working fine but when I tried to access the IIS, I faced this issue.

The problem is the site deployed in IIS is not showing up when I tried to browse it. It displays the Forbidden error for directory listing. When I find help thru F1, It says that by default (or in new IIS which is not configured) Directory Browsing feature in IIS will be in disabled mode for websites.

Also it says to enable this feature to resolve the issue – Forbidden error.

I thought 🙂 this is the cause of IIS not opening my website and as mentioned I have enabled the Directory Browsing feature in IIS by selecting the option ‘Directory Browsing’ from features view of the website and clicked ‘Enable’ from the Actions panel (right most panel).

After doing an iisreset and refreshing the page, gives me the files and folders from the virtual directory and not the web page :(. Still I couldn’t figure out why I am not getting the web page from the deployed site.

Questions:

Is this an issues with IIS configuration / website deployment problem / functional issue with website?

I tired to deploy the same website in another VM which is in use for a long time. Here I am able to view the WebPages. Now I figured out that the new VM is having some issues in IIS configuration.

Yes. I missed some steps in IIS configuration and this issue is resolved for me by a thankful team mate.

He just ran — C:\windows\microsoft.net\framework64\v4.0.30319\aspnet_regiis /i

The cause:

When I initially steered to setup the VM, I directly installed .NET framework and the required software. I installed IIS at the last.

If you install IIS after .NET framework or if you removed and reinstalled IIS on a server that has .NET framework then rendering of your ASP.NET pages might not work.

This is because you are missing the IIS mappings associating the ASP.NET file extensions.

Solution:

1. Open the command prompt

2. At the command prompt, execute the following command

“%windir%\Microsoft.NET\Framework\–version–\aspnet_regiis.exe” –i

Note: –version– is a placeholder which should be replaced with your .NETVersion folder name.

3. Execute the command iisreset and refresh the webpage.

Enabling the directory browsing is not related to this issue and it is your preference to do so. I would recommend disabling it as a security measure to avoid exposing your files in IIS.

Hope there are 101 ways to automate…

Thanks & Regards,
Giri Prasad

Hi,

After posting few articles in TestComplete I still wonder whether I have explained how to start with TestComplete and basically automate an application. This article might be little basic or late but I am publishing it before is too late.

How to start exploring TestComplete? What are the TestComplete resources available for a beginner which helps one to master it? How to automate an application? – These are the few questions I faced

TestComplete is proprietary test automation tool owned by Smart Bear. This tool is available for trail with 30 days for beginners.

  • Once you installed TestComplete (must include ‘Sample Scripts’ during install) in your machine, navigate to the folder C:\Documents and Settings\All Users\Documents\TestComplete X Samples. Here you can find the set of sample projects available for all the supported languages in TestComplete.
  • The best way to start exploration is to understand sample exercises/scripts. The scripts folder contains sample scripts for all the topics in TestComplete and other folders have supporting applications for the test projects.
  • Use support from Smart Bear and refer articles, screen casts and blog entries.
  • Best practice is to as you learn, share your findings / workaround / issues / doubts to the community or within your team where you can get clarified and be clearer on the topics you have explored.

Someone might feel like – Not enough time to go thru all the resources for understanding? Just start to automate a small application. You will learn as it on the go. (But this is recommended if you have prior experience in Test Automation!!!)

To start with, take a small scenario like editing a notepad and saving (or) automating the windows calculator. Straightaway go for recording the actions on the application and playback it to verify the test running again!!!

By this approach you will understand how TestComplete reacts to your actions to achieve the scenario if dive in to the recorded test scripts.

Regarding this, I have written an entry in TestComplete blog space on ways to speed up our automation efforts and few framework related points as “Rapid Test Automation using TestComplete”.

If you are already known with some of test automation tools, make a comparative or case study to understand exactly what TestComplete will do or not.

Once we are familiar with TestComplete as an automation tool, try to concentrate on any one of the scripting language it supports. Just for your reference – It supports 5 scripting languages: Jscript, VBScript, C# script, C++ script and Delphi script.

You may refer these links for your exploration,

Jscript – http://msdn.microsoft.com/en-us/library/hbxc2t98%28VS.85%29.aspx

VBScript – http://msdn.microsoft.com/en-us/library/t0aew7h6%28VS.85%29.aspx

Please free to comment or  share how you have started your exploration…

Thanks & Regards,
Giri Prasad
Believe!!! There are 101 ways to automate…