Understanding and working with Docker compose

dockercompose

So far in ExecuteAutomation, we discussed about Docker a lot ranging from

In this post we will understand and work with Docker compose.

What is Docker Compose?

  • Compose is a tool for defining and running multi-container Docker applications.
  • With Compose, you use a Compose file to configure your application’s services. Then, using a single command, you create and start all the services from your configuration
  • Compose is great for development, testing, and staging environments, as well as CI workflows

Docker compose manages Services

Docker compose commands helps to

  • Start, stop and rebuild services
  • View the status, logs of running services

Docker as CI?

  • An important part of any Continuous Deployment or Continuous Integration process is the automated test suite. Automated end-to-end testing requires an environment in which to run tests.
  • Compose provides a convenient way to create and destroy isolated testing environments for your test suite using compose file

What is Compose files?

Docker compose file is like a configuration file, where you define all the different stuffs we perform on command line (via powershell) into an file. But you can do more than what you do in command line as well

The file is basically an Yaml file (.yml)

Here are the complete videos of the above discussion

An Introduction to Docker Compose 

Working with multiple containers using Docker compose

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

specflow

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

ExecuteCharity Campaign pictures

022416_1540_NewsExecute1.png

Dear Friends,

Couple of months before ExecuteAutomation conducted an 1 week quick charity campaign and made donation for around 25 students food.

As promised, here are some of the pictures shared by the school management to ExecuteAutomation

Picture 1

35

Picture 2

03-1
Its really an proud moment, but hopefully next year campaign will be much better and broader than this year !

Thank you once again for making this happen !

Karthik KK

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

specflow

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

Code to run Selenium grid test on multiple docker containers

dockerSElenium

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 to Selenium grid with Docker

dockerSElenium

In our last few posts, we discussed how to working with docker, containers and working with multiple containers. In this post we will discuss how to work with Selenium grid using Docker.

What is Selenium grid?

SeleniumGrid allows you run your tests on different machines against different browsers in parallel. That is, running multiple tests at the same time against different machines running different browsers and operating systems. Essentially, SeleniumGrid support distributed test execution.

Selenium grid architecture with Docker

Getting things ready for selenium test

We need to have following installed in our machine before starting selenium grid test

  • 1. Docker for Windows
  • 2. Pulled the latest Selenium hub container
  • 3. Pulled the latest Selenium node for firefox/chrome
  • 4. Visual Studio 2015 (any edition)

Here is the complete video of the above discussion

Introduction

Initiating docker selenium grid container setup 

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

Linking and working with multiple containers with Docker

docker

In the last post we discussed how to work with single containers, in this post we will discuss how to work with multiple containers.

Linking docker containers with links

  • Links allow containers to discover each other and securely transfer information about one container to another container.
  • When you set up a link, you create a conduit between a source container and a recipient container.

In this example we are going to link the two containers shown below

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