Test Management Blog

How To Handle Errors And Exceptions In Selenium C#

January 29, 2024
In any test automation project you're going to run into errors. They might be errors in your programming. They might also be errors raised as your scripts try to interact with the application you're testing. Either way when an error occurs during the execution of your automation code it's considered an 'exception'. That is, your code can't continue to be executed as you intended; *an exception to the rules you've defined in your code has to be handled.* In this article we look at how C# deals with Exceptions and we look at the different types of exceptions you're likely to encounter with Selenium in C#. Contents C# Exception Handling The C# CLR Exception Object Exception Handling in C# Throwing...
Read more...

Using Jira JQL to Search for Issues based on Versions

September 21, 2023
In Jira we have the concept of Sprints and Versions. We've already covered Using Jira JQL to Search for Issues in a Sprint. In this post we look at JQL statements and functions you can use to search based on Versions. A Version in Jira is a milestone in your project. Think of it as a 'name' that points to a snapshot of something you want to release. Usually we'll have two version fields 1. Affects Version – the version of the app/product where we found the issue 2. Fix Version – the version of the app/product where we included the fix for the issue You may need to configure your issue layout to show both of these fields. If...
Read more...

Using Dates and Date Operators with Jira JQL

September 19, 2023
Let's take a look at using date fields and operators with Jira's query language. There are a few 'gotchas' to watch out for when using date values. Having said that there are also some really useful functions that will help you identify exactly what you need from your date based JQL queries Now the most straight forward example is something along the lines of project = "DX" and createdDate > 2023-7-03 Important to take into account that “greater than” is taken as the start of day 23-08-03. Jira JQL with Dates So really this query really means project = "DX" and createdDate >= 2023-07-03 For clarity and to avoid confusion sometimes it's better to work with times as well. Adds...
Read more...

Using Jira JQL to Search for Issues in a Sprint

September 6, 2023
Usually everything you do in Jira is orientated around a sprint. Your current sprint. Or perhaps even a past sprint or a future sprint. In which case you're going to come up against scenarios where you need a neat list of issues related to a sprint. In this post we look at three Jira JQL functions that you can use to help you search for issues in a particular sprint. If you're looking to find a list of issues that are related in some way to a particular sprint then we need to delve into a few JQL functions. Fundamentally an issue can be in Future Sprints, Open Sprints and Closed Sprints. The Backlog view will show us the Open...
Read more...

Using Jira JQL to Search for Related Issues

September 4, 2023
In this post we show you how to use Jira's advanced JQL language to search for related issues. Often in Jira you'll want to search and find issues that are related to another issue. Perhaps you have Child issues or Linked issues for a particular issue you're working on. You just need to list, in the search results, all these related issues. In Jira there are two ways to relate issues to each other… Two Ways to Relate Issues 1. parent / child – created with the 'Add a child issue' feature2. linked issues – created with the 'Link Issue' feature In our example above we have an Epic (issue key SCR-26) that has both child issues AND linked issues....
Read more...

A Quick Introduction to Using JQL with Jira

August 31, 2023
JQL, Jira Query Language. This is a quick intro to the power users approach to searching for issues in Jira. In this post we'll introduce you to the JQL basics and then in the next posts we'll start seeing just how powerful JQL is by looking at some specific use cases. To start using the JQL search feature in Jira you can just search for text here… Then you can switch to JQL mode by clicking on this link.. If you haven't used JQL before this will expose you to your first JQL statement that looks something like this. Where the format or syntax all boils down to three parts: You can think of the three parts as field: where...
Read more...

Dependency Injection and Context Injection

July 12, 2023
Inversion of control and dependency injection are big topics. I'm going to talk you through a high level overview of what Dependency Injection is and take you through the specific use case that SpecFlow refers to as Context Injection. Context Injection with SpecFlow Inversion of Control, Dependency Injection and Context Injection Inversion of Control (IoC)- A design principle (high level concept) used to achieve loose coupling of objects and creation of dependant objects. Dependency Injection (DI) РA design pattern (specific approach) that implements Inversion of Control (IoC). Context Injection РSpecFlow's specific implementation of Dependency Injection. So just think of it as a hierarchy. At the top you have the high level concept of Inversion of Control. Dependency Injection is a...
Read more...

The Driver Pattern

June 23, 2023
We’re going to take a look at a simple ‘Driver Pattern’ example. A simple example with a C# SpecFlow project. Think of this as a basic introduction before we take a look at a more complex, practical, example of the Driver Pattern with a Selenium Web Driver in SpecFlow. The Driver Pattern with SpecFlow I don’t think of the The Driver Pattern in the context of say ‘Gang of 4’ classic design patterns. It doesn’t really fall into any of the 23 patterns that are defined by the ‘Gang of 4’. To be honest I find it more logical to think of it just as refactoring. Pulling out code, that might be duplicated, and making it available as it’s own...
Read more...

The Factory Pattern

May 17, 2023
The factory design pattern solves one big issue – your clients having to know about all the different concrete class types that they may need to instantiate. Or to put it another way your clients just tell the factory what they need built and the factory returns an instance of the required class. We explain this in more detail below and/or you can watch this video. The Problem We're Solving Say you have a client application or class. In our example it's a simple console application. This console app is responsible for taking input from the user and then instantiating another class based on that input. The input provided creates an instance of ONE class from a range of similar...
Read more...

The TestComplete Namemap

April 11, 2023
When writing automated tests with TestComplete so much depends on Object Identification. If you can’t get that right then you may as well forget everything else. Get the identification of your objects right then you’re building a good solid foundation for the automation scritps you’re developing. The key feature in TestComplete that supports your ojbect identification is the Namemap. A complicated little beast. Once mastered, will make all the difference to the reliability and maintainability of your scripts. What is this Namemap though? Well you can think of it as just a list of objects (web pages, buttons, text boxes, whatever) that you need your automation scripts need to interact with. It doesn’t just cover the WHICH objects. It’s also...
Read more...