Tag: executeautomation

Passing parameters to NUnit test via CLI using params

In this post we will discuss yet another useful feature introduced in NUnit 3.x where we can pass a parameter to NUnit test class of C# from Command Line Interface (CLI) using a new feature called –params

Passing parameters

Starting NUnit 3.x, there is an most awaited option introduced for Nunit-console runner, which is passing parameters to test method(s) via CLI using –params

What’s the use case of this?

Consider a scenario something like this, Lets say we have to test application with multiple browsers and we somehow have to parameterize the BrowserType like Firefox,Chrome,IE

Then, we can do it via CLI and pass the parameter to the whole framework to run test based on the parameter (browser type) that we passed.

Here is the complete video of the above discussion

Here is the complete modified code

You can checkout the complete code from GitHub here 

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 multiple data using DataTable in Cucumber for Java

In our last post we discussed getting started with cucumber for Java, in this post we will discuss working with multiple data using DataTable in Cucumber for Java. We have already discussed about working with multiple data in Specflow of C#, which has Table class, but here in Cucumber for Java they have class named DataTable.

Working with multiple data in Cucumber

We might need to supply multiple data instead of hardcoded value passed in steps from feature files, this happens most of the time while working with your project

This can be done using DataTable class available in Cucumber, basically DataTables are of type List<List<String>>

Table in the scenario looks something like this

Here is the complete videos of the above discussion

Working with DataTable using DataTable.raw()

Working with DataTable using custom class

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

Getting started with Cucumber for Selenium

In this post we will discuss about getting started with Cucumber

Cucumber

Cucumber is a tool which helps Behavioral Driven Development (BDD).

Cucumber as a tools support different language implementation like Java, JS, PHP, Ruby, C# etc.

We have already discussed about C# based implementation of cucumber in our ExcuteAutomation channel a lot using tool called Specflow

Installation pre-requisite

In this video series, I am going to use IntelliJ IDE running on Windows 10 operating system, but you can use any IDE you like

Along with that we need following JAR files

  • Cucumber-core
  • Cucumber-java
  • Cucumber-java-deps
  • Cucumber-jvm
  • Gherkin
  • Selenium (and its related jars)

Here is the complete videos of 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

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

An Introduction to Cucumber for Java

In this post we are going to discuss about cucumber for Java implementation, well, from this post, we are starting an all new series of Cucumber with Selenium video series as well as posts as a discussion.

Introduction

BDD – Behavioral Driven Development is based on Test Driven Development (TDD) and it aims to bridge the gap between Business analyst and developers.

BDD not only bridges the gap between business analyst and developers but also between

  • Manual QA with Automation testers (who write BDD)
  • Manual QA with Developers

BDD seems to be like a plan text, but they have their own syntax based on certain tools (which we will discuss next)

BDD Supported tools

There are many tools available to support BDD, some most famous tools are

  • Cucumber
  • Jbehave
  • Nbehave
  • SpecFlow

All the above tools are used in conjunction with many different platforms and languages like JAVA, C#, Ruby, Python, Jruby etc

But all the above tools have one language in common, which is Gherkin

Gherkin

  • Gherkin is the format for Cucumber specification.
  • It is a business readable, Domain specific language which will let anybody to understand the software behavior easily (effortlessly), since they are PLAIN TEXT.
  • Gherkin has some spaces and indentation to define structure.
  • Gherkin has very few syntax which make the parser (the tool which uses Gherkin) to behave based on the structure.
  • The syntax of Gherkin is very simple and are pretty readable as plain text

Gherkin Syntax

Here are few syntax of Gherkin

  1. Feature
  2. Background
  3. Scenario
  4. Given
  5. When
  6. Then
  7. And
  8. But
  9. Scenario outline
  10. Examples
  11. Scenario Templates

It looks something like this

Here is the complete video of the above discussion

Read more

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