Category: C#

Running C# code on Raspberry Pi 3 with .Net core 2.0

In our last video in YouTube channel of ExecuteAutomation we discussed how to install Windows 10 IoT on RaspberryPi 3 and access it via Powershell and device portal, in this post we will discuss how to run an simple C# console application on RaspberryPi 3 with .Net Core 2.0 framework.

Getting stage ready for .Net core 2.0 app

Before we start writing console application, first we need to have following pre-requisite environment setup

  1. Installing .Net Core 2.0 SDK in Windows 10 host machine, which you can see from here
  2. Should have at least VS code or VS 2017 community edition (to edit C# code)

Coding

Here is the simple code written to execute on RaspberryPi 3 running Windows 10 IoT

After Coding

Connect with Raspberry Pi 3 via power shell and enable FTP service to transfer file from host machine to Raspberry Pi 3

Running code on Raspberry Pi from Powershell

Read more

Selenium is now supported in .Net Core 2.0 Preview 2 with Visual Studio 2017 15.3

In this article we will talk about running Selenium test with .Net core 2.0 Preview 2 using Visual Studio 2017 15.3

I am very happy and excited to write this article, since many of automation testers like you and me were waiting for this news and its finally happening !

Here is the System Requirement for running Selenium with .Net core

  1. Download .Net Core 2.0 Preview 2
  2. Download Visual Studio 2017 15.3

Once installed, you need to follow following steps

Step 1

Create new Unit Test Project for .Net Core

Step 2

Add following Nuget references to the project Read more

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

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

Working with methods in C#

In the last post we discussed how to work with different types in C#, in this post we will discuss how to

  • Work with methods
  • Methods with different parameters (method overloading)
  • Methods with return types

Here is the complete videos of the above topics

Methods with return types

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

Working with Types in C# for Automation testing

In our last post we discussed about working with classes and objects of C#, in this post we will discuss about types in C#.

Types

Types are like blueprint of what we create, again more like classes that we discussed in previous post

Custom Types

As we already discussed in previous videos, classes are Types, but since the class in Program.cs is something you customized and created its called custom types

Pre-defined Types

In C# there are many predefined types as well for instance

1. Int
2. String
3. bool
4. double etc

Here is the complete video of the above discussion

Type casting

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

Advanced automation reporting system with EARS

ExecuteAutomation has released an all new course in Udemy on advanced reporting system for automation system called ExecuteAutomation Reporting System (EARS). ExecuteAutomation Reporting System (EARS) is going to be an unified reporting system for any type of automation testing. EARS is built using ASP.Net technology.

EARS will support any kind of automation tools/technology you use like

  • Selenium
  • Coded UI
  • Appium/Robotium etc

As that said, EARS is going to have following features built right into it

  • Single point reporting for automation testing
  • Historical test report maintenance (EARS_DB)
  • Historical search (EARS_DB)
  • Historical store for external reports like Pickles (EARS_DB)*

EARS

You can find the complete course from here https://www.udemy.com/creating-automation-reports-with-ears

Here is the introduction 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