Installation Guide

How to Create an Initial Testware Automation SDK Project

Introduction

This document will describe how to create an initial Visual Studio solution for a new Testware Automation SDK project. The custom application 'Rojabo' is used as an example throughout this guide and may easily be replaced with another custom application name. The overall solution name will be used when generating classes etc. and is therefore restricted to follow the general C# class naming convention.

Creating A Visual Studio Solution

From within Visual Studio create a new solution for your Testware Automation SDK application. Choose a Blank Solution with a proper solution name and location in the New Project dialog.

Screenshot

Creating the Console Project

Add a new Console Project to the Solution. The name of the Console Project should reflect the namespace used within the project.

Screenshot

Adding Spider NuGet Package

Add the ‘Testware.Web.Spider’ NuGet Package to the project. The package will install required binaries for the Console project.

Screenshot

Creating the Enroller Class

Create a new class for enrollment inherit from ‘GenericEnroller’ class. The name should reflect the application name. Additional enrollment customization may if required be added later during this installation procedure.

RojaboEnroller.cs

using HtmlAgilityPack;
using System;
using Testware.Web.Enroller;
using Testware.Web.ObjectRepository;

namespace Rojabo.Web.Spider
{
    public class RojaboEnroller : GenericEnroller
    {
        public RojaboEnroller(WebObjectRepository _webObjectRepository, EnrollerConfiguration _configuration)
            : base(_webObjectRepository, _configuration)
        {
        }
    }
}

Creating the Spider Class

Create a new class for the Spider application inherit from ‘GenericSpider’ class. The name should reflect the application name. Additional spider customization will be added later during this installation procedure.

RojaboSpider.cs

using OpenQA.Selenium;
using Testware.Web.Enroller;
using Testware.Web.Spider;

namespace Rojabo.Web.Spider
{
    public class RojaboSpider : GenericSpider
    {
        public RojaboSpider()
        {
        }

        protected override IEnroller CreateEnroller()
        {
            return new RojaboEnroller(webObjectRepository, spiderConfiguration.GetEnrollerConfiguration());
        }

        protected override void Initialize(IWebDriver driver)
        {
        }
    }
}

Creating the Program Class

Modify the already generated program class aimed for execution of the Testware Automation SDK application.

Program.cs

using System;
using System.Diagnostics;

namespace Rojabo.Web.Spider
{
    class Program
    {
        static void Main(string[] args)
        {
            Stopwatch sw = new Stopwatch();
            sw.Start();

            System.Console.WriteLine("Executing Rojabo Manager...");
            RojaboSpider spiderApplication = new RojaboSpider();
            spiderApplication.Execute();

            sw.Stop();
            System.Console.WriteLine("Elapsed in: " + sw.Elapsed.ToString(@"m\:ss"));
        }
    }
}

Creating the Application API Project

Add a new Class Library project to the Solution. The name of the application API Project should reflect the namespace used within the project.

Screenshot

Adding API NuGet Package

Add the Testware.Web.API NuGet Package to the project. The package will install required binaries for the Class Library project.

Screenshot

Creating the API Test Project

Add a new Class Library project to the Solution. The name of the application API Test Project should reflect the namespace used within the project. This new API Test Project must have a reference to the API Project.

Screenshot

Adding API Tests NuGet Package

Add the ‘Testware.Web.APITests’ NuGet Package to the project. The package will install required binaries for the Class Library project.

Screenshot

Validate the Visual Studio Project

Finally rebuild the solution and review the structure to be similar to following. This skeleton of a Testware Automation SDK solution is now ready for custom configuration setup.

Screenshot