- Languge: C#
- IDE: Visual Studio Code
- Source Code Management Tool: Github via Github Desktop
- Type of Tests: Ui Automation
- Website Tested: OpenCart Demo website
This is the missing episode. The one that I wrote and somehow inexplicably deleted (even from the trash). Rewriting as faithfully as I can the final project in my test automation portfolio series.
This time, its the one I put off until I was too far gone into the project to turn back. The one I was most nervous of attempting. Selenium 4.0 with C# to automate at the Ui level.
I used the amazing course by Carlos Kidman on Test Automation University as my starting point, and added a few additional bits and bobs along the way. I’ve since re-used this framework for another paid project, so proof that putting the effort into an automation portfolio pays off on many levels, thanks past Beth!
So, what does it do?
The framework uses Page Factory Model (POM derivative) to organise the code. It is written in C#, and a base class to store the startup/teardown info. The tests check basic functionality on the Opencart website. But I converted the version of Selenium to be the latest big upgrade, version 4.0. This meant I was itching to trying at least one of its new features. I went for relative locators:-
This allowed me to click a button by its relative location to another button. A little flaky in practice, but handy to know for future.
Here is a video I made that goes into more detail:-
Rex Jones II has a brilliant set of video’s which go into way more detail on all the other cool features too.
My strategy was basic, namely:-
- Get the original framework running.
- Upgrade Selenium
- Add in a drivers section so that the test can run against multiple drivers
- Convert the tests so they run against the Opencart demo website
Here is a video of how I overcame the difficulties of installing the Edge Chromium browser – not as easy as you’d think, and judging by the fact its my most popular video I reckon a fair few people agree with me!
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 if using the drivers is your thing:-
However, I’ve since revisited Carlos’s course, and added a lot more of the bits I missed out from the first framework in this new upgraded version here (so I’d suggest you use this one, unless you want the drivers in which case look at the other one, I’ll update this when I have time):-
A lot of people still default to using Selenium and Ui automation tools like it. We know that isn’t always the most robust way to automate, but once you have the framework up and running and just want a quick and dirty test, sometimes it is your best option.
When I finished this particular framework, it meant that my test automation portfolio that I’d set out to do 4 months before (target being 1 year) had been completed. I was ecstatic, and continue to be proud of this. Others have read these blog posts and been inspired to do something similar – I hope you may be one of them.
T’ra for now!