OpenQA.Selenium.DriverServiceNotFoundException: The chromedriver.exe file does not exist in the current directory

Problem I’m trying to use Selenium with the ChromeDriver and I’m running into the following exception: Unhandled Exception: OpenQA.Selenium.DriverServiceNotFoundException: The chromedriver.exe file does not exist in the current directory or in a directory on the PATH environment variable. The driver can be downloaded at http://chromedriver.storage.googleapis.com/index.html Solution The simplest solution is to install the Selenium.Chrome.WebDriver nuget … Read more OpenQA.Selenium.DriverServiceNotFoundException: The chromedriver.exe file does not exist in the current directory

OpenQA.Selenium.WebDriverException: Element is not clickable. Other element would receive click.

Problem I am using Selenium to automate navigating a website. I’m trying to click a button: When I try to click the button it’s throwing the following exception: OpenQA.Selenium.WebDriverException: Element is not clickable. Other element would receive click. The reason this is happening is because Selenium is trying to click the button by its coordinates, … Read more OpenQA.Selenium.WebDriverException: Element is not clickable. Other element would receive click.

Event-driven .NET: How to use query notifications in SQL Server to monitor database changes

How do you check for new records in a database and react to the new data? You really only have two options: Poll for changes every X seconds Use query notifications to be notified when new data is inserted In this article I’ll show you how to configure query notifications so that your application receives … Read more Event-driven .NET: How to use query notifications in SQL Server to monitor database changes

Event-driven .NET: How to add an event to a class

In the previous article we saw how events work. In this article I’ll show how to add an event to a class. In order to illustrate this I’ve created a simple chat app that uses an in-memory message queue. Each chat window is subscribed to the message queue’s OnMessageReceived event, and updates their UI upon … Read more Event-driven .NET: How to add an event to a class

Event-driven .NET: how events work

The very basis of event-driven programming is the concept of events. Events are an implementation of the Observer Pattern. With the Observer Pattern you have an observable entity and entities that want to observe that entity. Objects with events are observable, and other objects subscribe to those events and are notified when the events happen. … Read more Event-driven .NET: how events work

Find the distance between two coordinates using SQL and C#

Imagine you’re in the middle of Millennium Park in Chicago. You want some coffee, but want a good deal on it. You open an app and see the nearest coffee shops offering deals to anyone with this app. How did this app know the distance from you to the coffee shops? This article will show … Read more Find the distance between two coordinates using SQL and C#

Multithreaded quicksort in C#

One day I decided to challenge myself by trying to implement multithreaded quicksort. I wanted to see how it would compare to the built-in sort function – Array.Sort(). I came up with two algorithms that were 2-4x faster than Array.Sort(): Top-down: divide-fork-sort-merge Bottom-up: quicksort with fork-on-recursion After continuing to tinker, in attempts to further optimize, … Read more Multithreaded quicksort in C#

Run a Windows Service as a console app

When working on a Windows Service project you may want to run it as a Console App so you can see what’s going on. If you try to run the service in Visual Studio you’ll get an error that says: “Cannot start service from the command line or a debugger. A Windows Service must first … Read more Run a Windows Service as a console app

How to set a timeout for TcpClient.ConnectAsync()

TcpClient has no direct way to set the connection timeout. It doesn’t have any parameters that allow you to control it, and SendTimeout / ReceiveTimeout don’t apply to the initial connection. The way I control the connection timeout is by awaiting a Task.WhenAny() with TcpClient.ConnectAsync() and Task.Delay(). Task.WhenAny() returns when any of the tasks complete. … Read more How to set a timeout for TcpClient.ConnectAsync()

How to update UI from another thread

I often need to be able to run multiple threads and update the UI based on the results. For example, I may need to execute GET requests to 10 different endpoints concurrently, and then report their results in a datagrid as they come back. The problem is you can’t just update the UI from any … Read more How to update UI from another thread