Category: Specflow

bddwithspecflow

FindInSet an best way to verify Collection with Specflow Table

In this post we will discuss about working with FindInSet method of Specflow 2.1 (earlier versions don’t have this method).

FindInSet of Specflow v2.1

With Specflow v2.1, we now have a very handy method to verify an Specflow Table against an collection, which comes very handy while working with large set of data collection and verifying the same against an feature file specflow table something like this

Here is the complete video of the above discuss along with code demo

Here is the complete source code of the above video

Read more

ExecuteAutomation Reporting System (EARS) Outsourced

If you have already read earlier articles in ExecuteAutomation, we has taken effort to outsource as much source code as possible on GitHub

Today, ExecuteAutomation is happy to outsource on of the most exciting yet most requested tool developed for automation community which is

  • ExecuteAutomation Reporting System (EARS) along with
  • ExecuteAutomation Web Service System

You can clone the complete source code of ExecuteAutomation Reporting System source from here.

https://github.com/executeautomation/ExecuteAutomationReportingSystem/

Quick Introduction on ExecuteAutomation Reporting System (EARS)

If you don’t know what ExecuteAutomation Reporting system or EARS is all about, it’s an tool developed using

EARS stores automation reports for every test execution done on the framework which consumes it and display it with as much information as possible

Features

Here are some of the key features of EARS compares to other common reports like Extent Report or ReportNG (which is not even in development)

Historical

EARS shows report for every test sessions and stores them historically in MS SQL server database as shown below

Figure 1: ExecuteAutomation Reporting System Home Page

Searchable

EARS has powerful search capabilities like search by

  • Test case ID
  • Name (who executed it)
  • Date search

Supported automation tools

Supports automation testing tools like

  • Selenium
  • Coded UI Testing
  • Robotium

Stores Screenshot and detailed report

EARS also stores screenshot of failed test cases (coming soon)

Figure 2: Detailed Report

Stores pickles report

EARS also stores the most famous living documentation Pickles report

Where can I learn building this tool from ground up?

You can learn building ExecuteAutomation Reporting System and ExecuteAutomation TestHarness System from udemy course below

https://www.udemy.com/creating-automation-reports-with-ears

Here is the complete video of the above discussion

Thanks for reading the post and watching the video!!!

Please leave your comments and let me know if there is anything I should update in this post.

Thanks,
Karthik KK

specflow

Parallel execution with Specflow 2.0 + NUnit + Selenium

In the last post we discussed how to work with Specflow 2.0 parallel execution, in this post we will discuss how to run Multiple tests in parallel in multiple browser same time using Specflow + NUnit + Selenium.

Problem with Selenium WebDriver object while running Specflow test in Parallel

Since we will be using selenium webdriver object in many Specflow step definitions and while running tests in parallel, we will encounter NullReferenceException , in order to resolve the problem, we need to use two important techniques

  • Context injection (dependency injection)
  • IOC Container

IOC Container

  • In software engineering, inversion of control (IoC) is a design principle in which custom-written portions of a computer program receive the flow of control from a generic framework.
  • A software architecture with this design inverts control as compared to traditional procedural programming: in traditional programming, the custom code that expresses the purpose of the program calls into reusable libraries to take care of generic tasks, but with inversion of control, it is the framework that calls into the custom, or task-specific, code.

-Source : Wikipedia

So how code looks like for IOC Container?

Here is the complete source code in GitHub https://github.com/executeautomation/SpecflowSeleniumParallel

Here are the complete videos of the above discussion

Video 1

Video 2

Thanks for reading the post and watching the video!!!

Please leave your comments and let me know if there is anything I should update in this post.

Thanks,
Karthik KK

specflow

Running Specflow test in Parallel using Specflow 2.0 and NUnit 3.x

In this post we will discuss one of the cool new feature introduced by Specflow 2.0, which is Parallel execution support out-of-box along with NUnit 3.x.

Does NUnit 3.x support parallel execution?

Yes it does, NUnit parallel execution support is discussed in greater details in Selenium automation with C# video series of ExecuteAutomation youtube channel

Parallel execution consideration

In order to achieve parallel test execution, there are some important consideration needed to be taken care before you ensure your test runs properly

Parallel execution with memory isolation (AppDomain)

  • Ensure your test code executing the application is not depends on static states (e.g. external cache, databases etc), if so then
  • This can be achieved by isolating test into AppDomain, this ensures that every test execution thread is hosted in a separate AppDomain and that each thread’s memory

Parallel execution without memory isolation (AppDomain)

  • If your tests do not depend on any static states (ie. do not store any test-specific information in static fields), you can run the tests in parallel without AppDomain isolation

What’s the code change in existing specflow code ?

It’s fairly very simple, just one line of additional change in AssemblyInfo.cs file and you are good to go and the change is this

Here is the complete video of the above discussion

Thanks for reading the post and watching the video!!!

Please leave your comments and let me know if there is anything I should update in this post.

Thanks,
Karthik KK

PicklesLogo

PicklesUI an easy option to generate Specflow documentation

In the last post we discussed how to generate Specflow scenario documentation using Pickles with Visual studio package manager console via command line interface.

In this post we will discuss how to generate Specflow documentation using PicklesUI, which has an easy to use GUI as opposed to command

picklesUI

Here is the complete video of the above discussion

Thanks for reading the post and watching the video!!!

Please leave your comments and let me know if there is anything I should update in this post.

Thanks,
Karthik KK

PicklesLogo

Pickles an living documentation for Specflow feature file

In this post we will discuss about Pickles, an opensource tool for generating documentation for Specflow feature files.

What is Pickles

Pickles is an open source living documentation generator that works on feature files written in the Gherkin language, popularized in tools like Cucumber and SpecFlow.

Pickles can be incorporated into your build process to produce living documentation in a format that is more accessible to your clients. Gherkin language files are written in plain text and stored in your source folder

Pickles supported output formats

Pickles can produce output in different formats:

ØStatic HTML: a set of HTML files with minimal JavaScript

ØDynamic HTML: a JavaScript-rich single page app with integrated search

ØWord: Microsoft Word

ØExcel: Microsoft Excel

ØJSON: a custom JSON format

Installing Pickles via Nuget

The command to install Pickles from Nuget of Visual studio IDE is this

pickles

 

 

 

Here is the complete video of the above discussion

Thanks for reading the post and watching the video!!!

Please leave your comments and let me know if there is anything I should update in this post.

Thanks,
Karthik KK

specflow

Calling steps from step definition

There are situations where we might need to call a step or steps from within a step definition, so that

  • Number of steps within feature files can be reduced
  • Number of duplicate steps can be used

Hence the scenarios will look something like this, the second scenario step definition as you can see has a step (Given I login and enter user details) performs all the operation of scenario one by calling steps within step definition

Here is the complete video of the above discussion

Here is the complete code of the above video

Thanks for reading the post and watching the video!!!

Please leave your comments and let me know if there is anything I should update in this post.

Thanks,
Karthik KK