Tag: automation

Handling multiple assert in Selenium with Assert.multiple of NUnit 3.6

In this post we will discuss how to handle multiple assert in Selenium with Assert.multiple of NUnit 3.6, this is one of the most requested feature of NUnit.

NUnit 3.6

Nunit 3.6 released by Jan 9th 2017 has number of notable improvement and features something like this

  • .NET Standard 1.6 is now supported
  • Adds support for Multiple Assert blocks
  • Added the –params option to NUnitLite
  • Theories now support Nullable enums
  • Improved assert error messages to help differentiate differences in values
  • Added warnings with Warn.If(), Warn.Unless() and Assert.Warn()
  • Enabled Path, File and Directory Asserts/Contraints for .NET Core testing
  • Added NonTestAssemblyAttribute for use by third-party developers to indicate that their assemblies reference the NUnit framework, but do not contain tests

Where is Assert.Multiple helpful ?

Consider a scenario something like this

Lets say we have to test multiple properties of an UI element in Selenium

In Nunit test framework, if the first assert fails (not meeting the condition), then the second assertion will not even takes place and the whole test fails (which we all know)

But using new Assert.Multiple method, the code can be written something like this

Benefits of Assert.Multiple

Read more

Working with Cucumber Hooks to Initialize and Teardown tests

In our last post we discussed working with multiple data using DataTable and Custom classes of DataTable, in this post we will discuss working with cucumber hooks and how helpful it is to initialize and teardown different test artifacts

Cucumber hooks

If you are from Specflow background, you might have noticed there are different types of hooks available like

But unfortunately in cucumber for Java we only have two hooks

  • @After
  • @Before

Limitation in cucumber for Java

In Specflow, you can call hooks for each and every steps, features, scenario, scenario block or whole test run, but its not possible with cucumber for Java

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

Setting Selenium grid with Docker compose

In our last post on docker compose, we discussed what docker compose is and how to work with docker compose in much greater working detail.

In this post we will go a step further to configure selenium grid with docker compose. We have also discussed about configuring and working with Selenium Grid using Docker in greater detail in our executeautomation, please go ahead and read the article from here

Here is the complete video to configure and work with Docker compose for Selenium grid

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

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

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

Code to run Selenium grid test on multiple docker containers

In the last post we discussed how to setup selenium grid containers with Docker, in this post we will discuss how to run test on multiple docker containers in parallel using docker command.

Here is the complete source code of this article

https://github.com/executeautomation/SeleniumParallelSample

Sample snippet

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

Introduction and getting started with C# for automation testing

In this post we will discuss a very brief introduction of C# and getting started with C# using Visual Studio 2015 for automation testing. This post and upcoming post are part of C# for automation testing course.

What is the motivation behind this course

ExecuteAutomation is trying to help people from different background in automation testing world, especially people from Manual testing .There are 100’s of questions I get each months (not day yet) from people asking on the importance of C# for automation testing.

Here is the complete video of the above discussion

Introduction

Getting started

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