Creating A Test Automation Portfolio The Final Episode: UI Web Browser Testing Using C#, Selenium Webdriver 4

TL:DR

You’ll have to forgive a bit of showing off in this post, because I BLOODY WELL DID IT! At the start of August 2020 I set myself a 1 year goal to write 5 example automation frameworks focusing on the use of different tools, languages and layers of the application.

This has taken a LOT of effort, and even now the frameworks are far from perfect, but I have learned a heck of a lot in the process and now have a decent jumping off point of examples to use in my testing toolbox in the future. Chuffed with myself doesn’t come close.

I always like to help others out who may be starting their automation journeys too – so I’ve made all the code repo’s public, you can find them here:-

https://github.com/askherconsulting

The Project

This time I wanted to shake things up a bit and picked a C# Test Automation University course by the excellent Carlos Kidman. The code was written a few years back so the github repo provided no longer worked out of the box, plus I had the additional challenge of wanting to learn a few extra bits including:-

  • running tests in multiple browsers (especially Edge Chromium)
  • using at least one Selenium 4 feature (I chose relative locators)

So, what does it do?

This framework runs 3 basic tests against the Opencart admin demo site:-

  • Logs in
  • Logs out
  • Views orders

Key Features

It is structured using Page Object Model (also utilising the Page Mapping style which was a new one on me) and uses clean coding practices. It also has a nice testing base class which stores all the setup and teardown instructions.

In future, I’d like to come back to this and add all the cool features from Carlos’s course including extending IWebElement in order to customise features, making tests run in parallel and using a JSON file to configure the framework. But I didn’t want perfect to be the enemy of good – we’ve all been there right?

I created separate youTube video tutorials once I’d gotten my head around how to do some of the extra fun bits:-

Youtube Tutorial on How to Run Tests In Selenium Using Edge Chromium Browser
Youtube tutorial on how to use Relative Locators in C#

The Code

I’ve published my repo as a template, which means you can use it as a basis to begin your automation framework. Check it out here:-

https://github.com/askherconsulting/CSharp_.Net_Selenium_Automation_Portfolio

Lessons Learned

Completing my goal in the space of 4 months has not been easy – but I’m so pleased I did it. I’ve had amazing feedback from the likes of Taiko, Postman and of course the legend that is Angie Jones – who’s article was the inspiration for doing this whole exercise in the first place.

I have also learned that asking for help gets serious results. The testing community is hugely supportive and, provided you always give credit where its due, people will bend over backwards to lend a hand. Contributors to this project have included:-

  • Danny Dainton
  • Carlos Kidman
  • Angie Jones
  • Marie Drake
  • Gil Tayar
  • Toby Steed
  • Joanna Denni
  • Mark Winteringham
  • Richard Bradshaw
  • Steve Mellor
  • Brendan Connolly

Its also worth noting that all the learning material I used and advice I received was absolutely free – creating this portfolio hasn’t cost me a single penny. For anyone in testing who is looking for a new years resolution for 2021 that could advance their visibility as well as connecting with industry leading folk a Test Automation Portfolio may be just the thing.

One thought on “Creating A Test Automation Portfolio The Final Episode: UI Web Browser Testing Using C#, Selenium Webdriver 4

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: