Wednesday, July 31, 2013

Creating a External Log in Telerik Test Studio

The Logs are basically useful in managing the Test Results. Also there is always demand from the manager or stack holders about the execution result of the script. So creating and maintaining the Test Execution Log by automation will enhance the quality of the framework.

The below code will allow you to create a customized Log in Telerik, Notepad, Excel. This log will consists of following:

  1. Total No of Test Steps
  2. Total No of Test Passed
  3. Total No of Test Not Executed
  4. Total No of Test Failed
  5. Also the Result message(eg. exception) can be shown in Log.  
So all these stuffs are going out by automation. Lets see how.....

Customizing the Log of Telerik: 
These statements will pass the string written under the Log.writeline to the Telerik Log.

Code:
            Log.WriteLine(result.Message);
                                //Write the message of Pass/Fail to the log of telerik
            Log.WriteLine("No of passed steps= "+ result.TotalPassedSteps);
//Shows the Count of Total Passed Steps
            Log.WriteLine("No of Failed steps= "+ result.Totalnotrunsteps);
//Shows the Count of Not Run steps
            Log.WriteLine("Total Steps= "+result.AllTestStepCount);
//Shows the Count of Total steps
*****************************************************************************
Customizing the Log in Notepad
Code:
System.IO.StreamWriter File=new System.IO.StreamWriter("c:\\source.txt");
// StreamWriter writes text files. It enables easy and efficient text output. This statement created the text file //in the specified location
            File.WriteLine(result.message);
            File.WriteLine("Message: "+ result.Message);
            File.WriteLine("Total Pass Steps= "+result.TotalPassedSteps);
            File.WriteLine("Total Fail Steps= "+result.TotalNumberOfNotRunSteps);
            File.WriteLine("Total Steps= "+result.AllTestStepCount);
            File.Close();
        }
*****************************************************************************
Customizing the Log in Excel

Microsoft Office is developed in Object Model. All the Office tools are structured as Object models.
Example: Excel 2010
Creating the application object.
Create the Workbook object by  application object.
Create the worksheet object by Workbook object.
Use the Worksheet object for different actions.

Code:

Microsoft.Office.Interop.Excel.Application excel07=new Microsoft.Office.Interop.Excel.ApplicationClass();
            Microsoft.Office.Interop.Excel.Workbook wb=excel07.Workbooks.Open(path);
            Microsoft.Office.Interop.Excel.Worksheet xlWorkSheet = (Microsoft.Office.Interop.Excel.Worksheet)wb.Worksheets.get_Item(1);
           
            excel07.Cells[1,1]=("Number of passed steps: ");
            excel07.Cells[2,1]=("Number of Not run steps: ");
            excel07.Cells[3,1]=("Number of fail steps");
            excel07.Cells[4,1]=("Total steps: ");
           
            excel07.Cells[1,2]=Convert.ToString(p);
            excel07.Cells[2,2]=Convert.ToString(nr);
            excel07.Cells[3,2]=Convert.ToString(f);
            excel07.Cells[4,2]=Convert.ToString(t);
            //excel07.Visible=true;

For more information about the Microsoft Excel Objects, Properties , Methods click here

Friday, July 26, 2013

Record and Playback in Telerik Test Studio

Telerik Test Studio comes with a comfort ease of testing by providing Record and Playback facility. Its just so simple to play with the application until and unless the objects are identified.

Point to Remember:
You perform recording only in Internet Explorer (IE), since telerik supports only IE for recording. You can run your recorded steps in in other tools such as Mozilla Firefox, Chrome, Safari.

We will do a sample record and playback on Google. Lets have a look.

1. First you need to create a New Project and a New Web Test in Test Studio.
2. Record button will appear after the Web Test. Click on Record button or right click the Web Test and click on Open, then click the Record Button.
3. IE will be opened with Telerik Test Studio Connection.
4.Enter the URL "www.google.com" in the Internet Explorer.
5. Enter the Text as "Software Testing" or anything in the search text box.
6. Click on Search button.
7. Close the IE and recording will be automatically stopped.
8. Respective steps will be created according to the recording.
9. Click on run button.



Lets have a look at the Recorder Screen and understand its various features:



Wednesday, July 24, 2013

Telerik Test Studio

Telerik Test Studio is the Functional, Regression and Performance Testing Tool.

Its a complete package for testing the Web Applications,Silverlight Applications, WPF and Manual Testing. It is a Record and Play back tool where the steps are auto generated by recording and also you can do custom coding. The languages supported by Telerik test studio are C# and VB for writing the scripts.

You can download the trial version for 30 days of the Telerik Test Studio by clicking here.

After installation when you will open the Telerik Test Studio, the first screen which will appear is as follows:


It will ask you whether you want to create a new project, Start Recording Directlly or you want to open an existing project.

Creating a New Project:
Click on "Create New Project". New Project dialog box will be appeared asking for Project Name and Location as shown below:


 A new test project will be created in Project Section. Now click on New Test button on the top ribbon and select the type of test you want to create. Here in our tutorial we will start with the web application.



Tuesday, July 23, 2013

Automation Testing Tools

Automation Testing is making its own way in Software Testing and Quality. IT market is flooded with different tool and technology both for developing as well as testing. 

Just imagine 

  • How it would be possible to manually test a Windows Calculator with at least 3 digits as input and verifying the results.
  • Load testing of a website for 100 users will require 100 people with 100 systems and a instructor to ask them to do the task at the same time.
  • Defects that are so badly fixed that they are making your running modules defective. Finding the new defects will be again a new challenge.
  • Also imagine a relaxing tester with a cup of coffee in the middle of release, since the test cases are automatically executed with a record of pass and fail, defect report is generated automatically and the stack holders and managers are getting the reports automatically by email after every interval. Yes of course this level of comfort is achieved with some code/programming knowledge.
Software Testing Tools are nothing but the software for testing another software.

Well talking about the automation testing, there are plenty of tools available in the market which are categorized according to their use. Some of the categories are the following:
  1. Functional and Regression Testing Tool: QTP,Selenium, Test Studio, RFT
  2. Unit Testing Tool: Junit,Nunit
  3. Test Management Tool: QC
  4. Performance Testing Tool: Load Runner, Silk Performer, Neoload 
  5. Bug Tracking Tool: Bugzilla, Jira
And lot more...

Some of the tools are costly and some tools are open source tools. Also the automation testers are highly paid in the industry.