Mar 28, 2014

Automation Framework Development - Various Stages

Stages

Activities and Steps

Output/Results

Application Study
    • Study application
    • Initiate Knowledge Transfer sessions
    • Review  existing Testcases
    • Analyze Test processes / environment
- High level understanding
- Know supported browsers,
 Test environment, test processes
Feasibility Analysis
    • Automation feasibility
    •   Prototyping
- Feasibility checklist
- Automation model
Scope
    • Identify scenarios to be automated
    • Estimation
- Features in scope of automation
- High level estimates
Test Planning
    • Schedule planning
    • Resource planning
    • Training needs assessment
    • Hardware needs assessment
- Automation Test Plan
- Team setup
- Training plan
Test Design
    • Define standards to be followed
    • Framework Design
    • Define Test cases, populate test data
- Coding standards
- Framework libraries identified
- Format of configuration, UI/Data map files identified
Test Development
    • Framework Development
    • Test Script Development
- Framework libraries
- Framework functions
- Page Objects
- Test scripts
Test Execution
    • Execution strategy
    • Script execution and analysis
    • Results reporting
- Formatted test results
- Test summary reports
Maintainance
    • Update test scripts
    • Add new test scripts
- Updated test scripts
- Updated function libraries

Mar 12, 2014

Testing GetWeather webservice using Nunit and .Net

We need .NET framework (Visual Studio 20XX) to carry out web services testing using NUnit. We would need to create new Project/Solution in Visual Studio from File > New > Project (as shown in below fig)

Select ClassLibrary Project and provide some name and click on Ok. (Class library is a library of classes, interfaces, and value types that provide access to system functionality.)
Once the project is created, add the NUnit dlls (nunit.core.dll and nunit.framework.dll) to integrate NUnit with .NET. Right click on References and click Add Reference.

Once the dlls are added, provide attributes [TestFixture] to Class and [Test] to method(s).

NUnit will understand from these attributes that the class is TestClass and the method is TestMethod which we are going to Test.

After this add a web-reference for WSDL by right clicking in references and select "Web Reference". and provide the WSDL URL. In this case : http://www.webservicex.net/globalweather.asmx?WSDL.

After the nunit reference and web service reference are being added, create a class and paste below code in class:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using WebserviceX.GlobalWeatherWebService;


namespace WebserviceX
{
    [TestFixture]
    public class CurrencyConvert
    {
        private GlobalWeather gw=new GlobalWeather();
        public String city;
        public String country;

        [Test]
        public void TestGlobalWeather()
        {
            String weather = gw.GetWeather("Hyderabad Airport", "India");
            Console.WriteLine("weather : " + weather);
            Assert.IsNotNull(weather,"Null Response");
        }
    }
}
 Now build the solution file. After the build is successful you can see .dll file is created under bin/debug folder of your parent solution directory.

To test :
1. Open Nunit 
2. Load the .dll file which was generated after building the solution. From File > Open
3. Select the method and click on Run.

Using this you can get weather for any city in world. :)