Articles On Testing

Wecome to !!!

Articles On Testing

Wecome to !!!

Articles On Testing

Wecome to !!!

Articles On Testing

Wecome to !!!

Articles On Testing

Wecome to !!!

Showing posts with label .net testing. Show all posts
Showing posts with label .net testing. Show all posts

Coded UI Automation Testing Walkthrough : Description of Record Buttons

        This is which will let you explore of how the UI looks like after we have added a Coded UI test item into our project. A class file gets generated with the C# code language and the small pop up comes at the bottom right corner of the screen. Going for the code details , it has three segments to be understood for the sake of good logical flow understanding of us all. The default name that the Coded UI test file has is CodedUITest1.cs. This is a class file, drilling down into the same gives us insight into the Constructor of this very class having the same name , Then we have one method name which by default has the the same starting name Prefixed to it hence the name being : CodedUITestMethod1.

So now we have three code segments with us, namely a class file having the same class name then a constructor and finally a Method name associated with it. Do keep intimated that  these are default named components and the same can be renamed as per our wish. Going at the top within the source file , we have the Namespace with which this very Class file is associated namely : TestGmail, if you can remember it is actually the same as the Project name we have associated with our current discussion. If you are aware of the hierarchy that the .Net framework follows is of Namespace, Assembly, Class, Method.

The bottom right corner of the screen lists a small pop up window which is actually the Recording tool and is the new addition that has added to great flexibility of this very tool to Testers and rapid Automation.It infact has associated with it three main buttons that are of preliminary interest to us, and one more button which is of important analysis interest. We will be discussing them all one at a time. And again while using them in our complete walkthrough of this very course shall let us have practical exposure to a profound extent. The first red coloured button is a recording button which when clicked turns into a Pause like button and instantly recording starts happening. Do remain informed that whatever you do with your machine after clicking this very button from red to pause will get recorded.
Is this a shortcoming , or do we have any option to control whatever we have recorded, at times things unknowingly which should not have been part of any recordings. Yeah we can control it in two ways, One is suppose we have some new mails in our outlook inbox and we wish to check the same , we can click on the Pause button(Record button in Record mode becomes Pause button) and check the same. Another case arises when we unknowingly out of some surprise just check the mails of "sweets at my desk", without actually clicking on the pause button.Do we have an alternative on the same, yes, we have one button just to the right of Record button, you can click on it to view the Recorded Steps.
 Since the content is in the simple english language , anybody can understand the same, and select and delete the recorded steps which are of no relevance to our business requirements.This is a flexible utility to be used in cases wherein we may have the privilege of enjoying chat with friends online in the communicator while record is on. Third from left is the "Cross Hair" button which is simple Validation button used to put some assertion on the system under test, by dragging it on the control content that needs to be validated. Do remember that it is the analog of the Checkpoint provision provided within the QTP tool. We shall definitely take this in detail. Fourth and final one is the "Generate Code " button , which as the name suggests is the code generator tool for all the Recording and the Validations that we have been putting on the system. Herein we have the option of checking the complete code that ought to be generated in order to make the VSTS playback the recorded scripts.Let us have a look of all these one at a time.

Some Related posts on Coded UI Testing using VSTS :

Coded UI Automation Testing Walkthrough : Recording

Coded UI is basically a Functional Test Automation Technique which might just gain a great market share with the Microsoft reputation in terms of its ability to provide the industry with best of the possibilities to be existent with some rigorous marketing initiatives . Testing when incorporated in the AGILE mode of development frameworks have the concept of Automation getting into some sort of Quick & Dirty Method technique that might generate some ROI in small time frame with low risk at stake even though the same scripts might just be a waste for long term accomplishments.

Herein will be introducing some good basics regarding pre - recording care that we should take to keep things more organized and modularized.

1. Option for configuration  management comes up in a pop up window which can be utilized in case some TFS integration has been placed and the Sprint tracking has been done for the Builds and corresponding scripts mapped and recorded as such, however in the current context it can be just cancelled and progressed.

2. There is also a Unit Test file which gets default generated which can be simply deleted to avoid confusions that might just occur due to such unnecessary file's presence.

3. Now you can just Right click the Project name which is the same as was entered during the Project creation window. Add new Item, then select Coded UI Test.

5.A record window comes up , by default selection being the first one which is what we need to progress with as TFS integration is not considered herein, and we can progress by clicking with the OK buttton, and wait for the small pop up at the corner right to come up.

Some Related posts on Coded UI Testing using VSTS :

Coded UI Automation Testing Walkthrough : Introduction

In this section we shall be just discussing how to start with Functional automation Testing using the Coded UI Test Feature introduced very recently with the VSTS2010 release.
Prime Concern that are going to be in here are :

1. Open the Visual Studio Team System .
2. Start with creation of a Test Project.
3. Selecting the Project Coding Language.
4. Giving the Project Name.

Some Related posts on Coded UI Testing using VSTS :

Export GridView To Word/Excel/PDF/CSV in ASP.Net

To retrieve the records from a table fom within a database is perfectly easy via the gridview server control which can be bound via some queries specific to the requirements.

However what ought to be done when we have to export the data into a Word/Excel/PDF/CSV format ?

Does it seem tough. May be but here in we go with the simple though tricky codes :

protected void btnExportWord_Click(object sender, EventArgs e)



Response.Buffer = true;



Response.Charset = "";

Response.ContentType = "application/ ";

StringWriter sw= new StringWriter();

HtmlTextWriter hw = new HtmlTextWriter(sw);

GridView1.AllowPaging = false;







Visual Studio 2008

Visual Studio 2008, codenamed  Orcas , was released to MSDN subscribers on 19 November 2007 alongside .NET Framework 3.5. The codename Orcas is, like Whidbey, a reference to an island in Puget Sound, Orcas Island. The source code for the Visual Studio 2008 IDE will be available under a shared source license to some of Microsoft's partners and ISVs.Microsoft released Service Pack 1 for Visual Studio 2008 on 11 August 2008.

Visual Studio 2008 is focused on
development of Windows Vista, 2007 Office system, and Web applications. For visual design, a new Windows Presentation Foundation visual designer and a new HTML/CSS editor influenced by Microsoft Expression Web are included. J# is not included. Visual Studio 2008 requires .NET Framework 3.5 and by default configures compiled assemblies to run on .NET Framework 3.5, but it also supports multi-targeting which lets the developers choose which version of the .NET Framework (out of 2.0, 3.0, 3.5, Silverlight CoreCLR or .NET Compact Framework) the assembly runs on. Visual Studio 2008 also includes new code analysis tools, including the new Code Metrics tool. For Visual C++, Visual Studio adds a new version of Microsoft Foundation Classes (MFC 9.0) that adds support for the visual styles and UI controls introduced with Windows Vista. For native and managed code interoperability, Visual C++ introduces the STL/CLR, which is a port of the C++ Standard Template Library (STL) containers and algorithms to managed code. STL/CLR defines STL-like containers, iterators and algorithms that work on C++/CLI managed objects.

Visual Studio 2008 features a XAML based designer (codenamed Cider), workflow designer, LINQ to SQL designer (for defining the type mappings and object encapsulation for SQL Server data), XSLT debugger, JavaScript Intellisense support, JavaScript Debugging support, support for UAC manifests, a concurrent build system, among others. It ships with an enhanced set of UI widgets, both for WinForms and WPF. It also includes a multithreaded build engine (MSBuild) to compile multiple source files (and build the executable file) in a project across multiple threads simultaneously. It also includes support for compiling PNG compressed icon resources introduced in Windows Vista. An updated XML Schema designer will ship separately some time after the release of Visual Studio 2008.

The Visual Studio debugger includes features targeting easier debugging of multi-threaded applications. In debugging mode, in the Threads window, which lists all the threads, hovering over a thread will display the stack trace of that thread in tooltips. The threads can directly be named and flagged for easier identification from that window itself. In addition, in the code window, along with indicating the location of the currently executing instruction in the current thread, the currently executing instructions in other threads are also pointed out. The Visual Studio debugger supports integrated debugging of the .NET Framework 3.5 BCL. It can dynamically download the BCL source code and debug symbols and allow stepping into the BCL source during debugging. Currently a limited subset of the BCL source is available, with more library support planned for later in the year.