Skip to content

Thomas Shipley Posts

Selenium Solved: Null Responses for HTTP Session Requests

Recently I was updating the UI tests in a project now Selenium Webdriver plays nice with .NET Core. And came across a strange error: View the code on Gist. What made this a strange error is it is a failure to communicate with the Webdriver Server, not my underlying application and because of this failure in communication Webdriver could not manipulate my website. The Fix After some googling, this turns out to be a straightforward fix – my project uses the Chromedriver server as it’s Webdriver for tests and simply the Chromedriver server executable I had locally was out of date when…

QA Interview Question: When Would You Not Use BDD Tests Like Specflow?

The Question When would you not use BDD tests like Specflow? This is a question I have often asked and been asked in interviews and it is a great one because it challenges the candidate to be critical of a practice which has a lot of a good press and isn’t something the candidate is likely to have a prepared answer for. Behavior Driven Development tests using tools like Specflow and Cucumber are a useful means to create tests but should the technique always be applied? Skills Assessed Critical Analysis Industry Awareness Explaining Concepts Peer-Driven Debate Answering the Question Like most interview questions…

Upgrading From IdentityServer 3 to IdentityServer 4

Upgrading from IdentityServer 3 to 4 isn’t too tricky but there are some traps you can fall into if you are not careful. Type Changes Scopes are now API Resources Scopes in IdentityServer 3 were used to define a resource and the secret required to get access to that resource. Now, this class has been updated to an API Resource as an example of how the new object might look like: View the code on Gist. As you can see above the Scopes are now handled as a property of an API Resource. Clients now request an API Resource and…

ASP.NET Core 2 Solved: Authorization was successful for user: (null).

While I was migrating an ASP.NET Core 1 project to version 2 my authentication code stopped working. After some investigation I kept running across this info message in my application logs which seemed unusual: View the code on Gist. The Fix Turns out this is a simple issue to fix. Just make sure that in the Configure() method in the Startup class contains a call to app.UseAuthentication() before the call to app.UseMvc() for example: View the code on Gist. With this method updated to include the Authentication middleware, the issue should be resolved.      

Introducing Machine Learning for QA Engineers

I believe it is a reasonable prediction that QA is one part of the software industry which will be disrupted by Machine Learning. And the role of a QA engineer will change as a result so it is important to have a grasp on the basics. This post will give you a high-level introduction to machine learning and the companies in the space working on changing how we assure quality. What is Machine Learning Arthur Samuel a pioneer in Artifical Intelligence supposedly defined Machine Learning as: Machine learning is a field of computer science that gives computers the ability to learn…

Implementing a Teardown Method in XUnit

XUnit is a free open source unit testing tool for .NET written by the original inventor of NUnit v2 which is great to work with and supports .NET Core, however, how it handles clean up is slightly different to other test frameworks you may have used. What is a TearDown Method? If you haven’t done much-automated testing before then you may not know what a TearDown method is. Typically its the method responsible for cleaning up after your test(s) have run. For example, an integration test might create data which is persisted to a database. Afterwards, this needs to be purged of data…

Specifying a Port Number to the dotnet run Command in ASP.Net Core

ASP.Net core lets you run a web server for your web application from the command line with the command: dotnet run But there is no command argument passing the port to listen on. For example in Ruby on Rails you could specify the port with the –port (-p) argument: rails server –port 2000 Instead, ASP.Net Core uses the environment variable ASPNETCORE_URLS to take a string representation of the port and hostname of the server. If you want to change the port that the server listens on at the command line you will need to set the environment variable. Which you can do within the scope of the…

How to Setup Anaconda on Mac OSX

What is Anaconda? Anaconda is both a data science platform and distribution of Python. But its also a nice way of managing multiple versions of Python and Virtual Environments (in the same way as VirtualEnv). Installing To install go to the Anaconda Downloads page and download the version dependent on the version of Python you would like. I used the graphical installer which is really straightforward. Only Use Anaconda Python in an Anaconda Virtual Environment Once the install is complete if you reload your terminal and check your python version (assuming you installed Python 3): > python3 -V >> Python 3.4.5 ::…

Ignoring Folders During Compilation in a ASP.NET Core RC2 Project

ASP.NET Core RC2 – DNX is dead. Introducing the DotNet CLI Until RC2 of ASP.NET Core, the responsibility for building a project was handled by DNX which has now been retired. This has been replaced by the .NET CLI. Part of the motivation for this is to have one tool fulfilling the roles of DNX, DNU and DNVM to try to make things less confusing for developers when they set up their environments. Ignoring a Folder in .NET CLI Compilation One of the quirks during the transition to the .NET CLI from DNX was my project failed to compile. This was due to a node package that didn’t support .NET…

Enabling Cascade Delete in EF Core Code First DB Using the Fluent API

Entity Framework Core Default Behaviour on Delete Cascade delete saves a developer time by not needing to write boilerplate code for related data when the parent data in the relationship has been deleted. However in Entity Framework Core it is not the default behaviour. It takes a more conservative view and sets the on delete behaviour to restrict (StackOverflow Question where EF Core Team Member Confirms) which the documentation defines as: Restrict: The delete operation is not applied to dependent entities. The dependent entities remain unchanged. – EF Core Documentation Compared with the definition of cascade: Cascade: Dependent entities are also deleted. – EF Core Documentation Enabling Cascade Delete Using The Fluent…