UI Automation With C# and Selenium: Adding Your Project to GitHub

The Takeaway: Using GitHub as your repository for version control makes development of your automation solution MUCH easier!

An important element of your automation project is to make sure you can keep it backed up and available. 

A great way to do that is with GitHub. As a version control system and repository, GutHub allows you to keep track of changes in your automation solution, make the code available to others working on the project, and fork your project in order to further develop the project in new directions.

This article will assume that you:

  • Already understand the basics of version control and repositories. If not, this video and associated YouTube channel can help out there
  • Already have a GitHub username and password. If not, do that here
  • Already have the GitHub Extension installed as part of Visual Studio, If not, here it is. 
  1. Open your Automation solution in Visual Studio. 
  2. Right-click on the solution for the project and select Add Solution to Source Control

    Visual Studio - Add Solution to Source Control
    Visual Studio – Add Solution to Source Control
  3. At this point, Visual Studio will create a git folder in the folder where your solution is saved (which is typically hidden). This folder is needed to keep track of changes to your solution

    Visual Studio - Git Folder Created
    Visual Studio – Git Folder Created
  4. You will also notice that your solution, folders, and files have a blue lock on them

    Visual Studio - Solution Locked
    Visual Studio – Solution Locked
  5. Navigate to the Team Explorer window

    Visual Studio - Team Explorer Home
    Visual Studio – Team Explorer Home
  6. Click the Sync link, and the Publish to GitHub option should display

    Visual Studio - Publish to GitHub
    Visual Studio – Publish to GitHub
  7. Click the Get Started link. Since the repository you just created doesn’t haver a remote version, we can use this tool to create a version on the GitHub website

    Visual Studio - Repository Details
    Visual Studio – Repository Details
  8. Click Publish. Now you should be able to go to your GitHub Profile, click your Repositories link, and view your repo
    GitHub - New Repository
    GitHub – New Repository

    Click here to find the above page, so you can either clone or download the files for this solution as well!

Leave a Reply

Your email address will not be published. Required fields are marked *