Skip to main content

Posts

Execute Selenium Tests (C#) through Azure DevOps (CI/CD) in Browser Stack

  Introduction Prerequisite s  Preparing the YAML Setting up the pipeline Conclusion Introduction : In this article, we will be seeing how we can build a CI/CD pipeline in Azure DevOps to execute selenium test cases with C# language binding and execute tests in Browser Stack. But before we go there let us check what is CI/CD. Continuous integration (CI) is a process in which several team members merge their code repeatedly into a shared trunk. Before every integration, the changes are validated through automated testing. In this manner, we can find issues as quickly as possible and prevent defects from entering our live environments.  Continuous delivery (CD) is the extension of continuous integration that automates deployments by making sure changes that have successfully passed the automated designated tests are made to the next environment automatically as soon as they are ready.  Continuous Integration/Continuous Delivery is a set of best practices and principles that engineering t
Recent posts

What is Azure DevOps Extension in Azure CLI and How to install?

  Azure DevOps Extension in Azure CLI expands the capabilities of the Azure CLI to interact with Azure DevOps services. It provides commands for managing work items, pipelines, repositories, test plans, and other DevOps resources directly from the command line. Here are the general steps to install the Azure DevOps CLI extension: Prerequisites : 1.        >  Azure CLI: Make sure you have the Azure CLI installed on your machine. You can download it from the official Azure CLI website: https://learn.microsoft.com/en-us/cli/azure/install-azure-cli Steps to Install Azure DevOps CLI Extension: 1. Open a Command Prompt or Terminal:            Open your command-line interface. This could be a Command Prompt on Windows, a Terminal on macOS/Linux, or Azure Cloud Shell.       2. Install the Azure DevOps Extension:             Run the following command to install the Azure DevOps CLI extension:                       az extension add --name azure-devops        3. Sign Into Azure De

ScenarioContext.Current vs Context Injection in Specflow

Within ScenarioContext in SpecFlow, there are two distinct ways to share data between steps in a scenario: context injection and current injection. Both approaches accomplish the same goal, but they are implemented differently. ScenarioContext.Current: A static attribute of the ScenarioContext class in SpecFlow is called ScenarioContext.Current. It offers a method for storing and retrieving data from various steps in the same scenario. By putting values in the scenario context during one step and retrieving them in another, you can use ScenarioContext.Current to communicate data between steps. Example: While ScenarioContext.Current is convenient, it has some drawbacks, such as being static and potentially leading to difficulties with running scenarios in parallel . Therefore, w ith SpecFlow 3.0, ScenarioContext.Current is marked obsolete.     Context Injection: Context injection allows you to use the step class's constructor to directly inject the scenario conte

How to handle multiple environments in the Node.js framework?

There are multiple ways to achieve it but one of the simplest ways is to use the Dotenv module. Dotenv is a lightweight and zero-dependency module that automatically loads environment variables from a .env file into the process.env object. Handling multiple environments using dotenv involves creating separate .env files for each environment (e.g., dev, testing, staging, production) and dynamically loading the appropriate file based on the current environment. Here's a step-by-step guide to follow:          Step 1: Install dotenv Package (recommended- locally):           npm install dotenv --save          Step 2: Create separate .env files for each environment. For example:         .env.dev for development         .env.test for testing         .env.stage for staging         .env.prod for production           Each file should contain environment-specific configuration variables. For instance: Step 3: Configure your application to read environment-specific variab

Clipboardy: Node.js library

 Clipboardy is a popular Node.js library that provides a cross-platform solution for interacting with the system clipboard. It supports both synchronous and asynchronous operations, and it can be used to copy, paste, and read the clipboard contents. Features of Clipboardy: 1. Cross-platform compatibility: It works on macOS, Windows, Linux, OpenBSD, FreeBSD, Android with Termux, and modern browsers. 2. Synchronous and asynchronous operations: It provides both synchronous and asynchronous methods for clipboard operations, making it suitable for a variety of use cases. 3. Copy, paste, and read operations: It supports copying, pasting, and reading the clipboard contents, making it a versatile tool for interacting with the clipboard. 4. Promise-based API: It is an asynchronous method that returns promises, making it easy to handle asynchronous operations in a clean and concise way. 5. Easy to use: It has a simple and intuitive API that is easy to learn and use. How to Use Clipboardy: To use

Playwright: Locator vs ElementHandle

  In Playwright, both Locator and ElementHandle are important concepts used for interacting with elements on a web page, but they serve slightly different purposes. Locator : A Locator in Playwright is a way to find and interact with elements on a web page. It represents a selector that can be used to locate one or multiple elements. Once you have a Locator object, you can use it to perform actions like clicking, filling input fields, or getting the text of the element. Locators are typically used in Playwright’s page object model for cleaner and more maintainable tests. When you perform actions using a Locator, Playwright automatically waits for the element to be present in the DOM before interacting with it. This helps in handling asynchronous content loading. Example : ElementHandle : An ElementHandle in Playwright represents a handle to a DOM element on a web page. It is a reference to the actual element and provides methods to interact with the element, such as clicking, typing, o

Winston- A logger for just about everything

       Winston   Winston is a popular logging library for Node.js applications. It is intended to be simple and adaptable, with support for a variety of transports, formats, and logging levels. As a result, it is a versatile tool for logging application events, failures, and other data.   Here are some of the key features of Winston: ·          >  Multiple transports: Winston can send logs to multiple destinations, such as the console, a file, or a remote server. This allows you to centralize your logs and make them easier to analyze.         >  Flexible formatting: Winston supports a variety of log formats, including JSON, plain text, and custom formats. This allows you to tailor your logs to your specific needs. ·          >  Logging levels: Winston supports multiple logging levels, such as error, warn, info, and debug. This allows you to control the verbosity of your logs. In addition to these core features, Winston also supports several advanced fea