Tag: 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

Writing custom configuration for Selenium automation framework

In this post, I am going to discuss about one of the important extension added in my Udemy course Automation framework development with Selenium C# (Advanced) which is custom configuration for selenium automation framework

Problem Statement

Currently in our EAFramework discussed in the course we are using GlobalConfig.xml file to read information for our framework as one shown below

Well, the problem with the above configuration is, while working with EAFramework in remote machines to deploy the code via

  • Jenkins
  • TFS or
  • Running in remote machines on Azure

Read more

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

Udemy course of ExecuteAutomation is chosen as BestSelling course

Hi Friends,

I am very happy to announce that our “Automation framework development with Selenium C# (Advanced)” course is chosen as the bestselling course.

The course has served many professionals to get their daily job done, since it has an ready-to-use framework along with many ancillary features (like reporting, test harness etc)

If you are not aware of the course content, here is a sneak peek video of the same

Here are the other courses released by ExecuteAutomation

Thank you once again !

Karthik KK

Identifying broken links with Selenium C#

In this post we will discuss one of the common question asked by many readers of ExecuteAutomation, which is the topic name.

Its actually fairly very simple though, I just wrote 10 lines of code to achieve it (you might have even better solution than one I have)

So, here is the pseudo code

  1. Navigate to the URL of site you are interested in
  2. Get all the links of page using FindElements(By.Tag(“a”)) method
  3. Iterate through the page URLs and get the attributes href using GetAttribute(“href”) method
  4. Use Simple WebRequest and HttpWebResponse class to get the page response and status code.

So, here is the output

Here is the source code

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