Git with Robot Framework

Git is an open-source distributive version control system, we can also call Git as a type of Backup, Git holds the history of all kinds of operations that you have done in each updated version, it also tracks the files, holds commit history, and allows you to make changes, undo changes you have made before. Git allows one or more people to work as a team on the same project, and we call this process as a collaboration.

Git Workflow Cycle

Here we will go through the basic Git workflow and some basic key concepts.

Working Directory

A working directory is used to modify the files, where it is a directory or folder on the computer which contains all the project or application files. The files within the working directory may or may not be controlled by the Git. There will be a hidden folder called .git folder that contains the actual git repository.

Staging Area

The staging area is also called Index, where the staging area holds /keeps all the files that are in the queue for the next commit. The files which are present in the staging area are not committed yet. we can move the files in and out from the staging area without affecting the git repository and its history of changes.

Once you perform commit operation, git sends files from the staging area to the repository. Once you complete the push operation, it will permanently store the changes in the git repository.

Git Repository

Git Repository is the one that contains all the files concerning the specific project application. Git Repository also includes a commit history and unique configurations in it.

The Complete GitHub Tutorial

GitHub in Robot Framework

GitHub is a Web-Based Hosting service mostly used for version control Systems through Git. It lets you and others work together on projects from anywhere.

Now to understand the entire Git workflow in the local and Remote side, we need to create a remote repository by using the GitHub, Then we can replicate the remote repository in the local system.

  • Once we have done with all the operations, finally we can synchronize back to the Github. Now let's see how to create a GitHub account.
  • Open a browser and navigate to
  • If you already have an account means your directed to sign in a page or else go to sign up.
  • Enter Valid credentials like username, email id, and password and click on sign up.
  • Now it will take you to the Welcome page, and there, you need to select the plans as Github is an opensource, and it will offer free service hence choose the plans according to your need.
  • Now your Github account has created.

Working with Robot Framework Jenkins

Creating a Git Repository in robot Framework

  • Open Github account, and in the main page right corner, click on the + sign, you will be suggested with a new repository, new project, etc.. select New
  • Enter the new repository name you wanted to create and select initialize this repository with and click on Create Repository.


Web Elements of Robot Framework

Configure Github Account in robot Framework

Before we are proceeding further with Git, we need to configure the Git repository. Git Requires two information such as username and email id.

  • Open Git Bash.
  • Enter the below Commands in the command prompt.
  • $ git config --global "your username"
  • $ git config --global "your email id"
  • Navigate to Github account and open your new repository, and now you wanted to copy remote repository into the local system through a process called cloning.
  • Copy the repository URL from the main repository page.
  • Open a command prompt and enter the command, as shown below $ git clone
  • Once we have done with cloning operation pass the command $ ls then it will list all the files which are present in the project folder, then do cd github_demo/ you will be directed to the github_demo.
  • Now pass $ git status command the repository tell us that it is on its master branch where the master branch is the default branch for Git Repository.
  • Let us see the relationship between the working directory, staging area, local repository, and remote repository by adding some text files.
  • First, create a simple text file by using the echo command $ echo "test quick start" >> great.txt
  • creating-text-file-great
  • Now press ls command, you can see the great.txt file in the working directory.
  • Use $ cat great.txt a command to see the content of the text file.
  • The great.txt file is showing under an untracked file because it does not add to the Git yet.
  • Now, let's add a text file to the Git by using the below command $ git add great.txt
  • Then check git status, it will show you a file in the staging area.
  • Commit the file in the staging area using the command $ git commit -m "adding text great txt file" Hence it will give you the below output
  • Since once you have done the commit operation, git returns as the working directory is clean. But Still, our file is in the local repository, its still not on the Github. Add these files to Github by push operation $ git push origin master
  • Here push command specifies the remote name, which is the origin, which is set up when we did cloning.
  • Once done with the push operation, we can check our results by refreshing the main page we will be able to see the great.txt file on the remote repository on Github.
  • If everything works well, then we can see the text inside the great.txt file.

User Defined Keywords Using Python in Robot Framework

Git Bash in Robot Framework

Git for Windows provides a BASH emulation used to run Git from the command line.

Installation of Git Bash

Navigate to, gitforwindows page will open as shown below and then click on the download button.

Once the application has downloaded, click on the download file and select Next, the application starts installing on your system. Once it completes installing, click on Finish

Go to the project folder and right-click on the folder DesktopApplication, in the drop-down list you will find the GitBash here option.


If you click on the Git Bash Here, the Git bash emulator will open.

Web Services Automation in Robot Framework

GIT Steps to push Flight application code to Remote repository in Robot Framework

Create a new repository on GitHub. To avoid errors, do not initialize the new repository with README, license, or gitignore files. You can add these files after your project has been pushed to GitHub. I have created my new repository Flight Application as shown below

Open Git Bash from your project folder, just open your project folder, right-click on it and select Git Bash Here.

Configure the Github username and password to create our identity by using the command $ git config --global "snapp123" and the password $ git config --global [email protected]

Initials the local directory as a Git repository by using the command $ git init

Add the files in your new local repository by using the command $ add .

After adding the file from the local repository, we need to commit by using the command $ git commit -m "This is my First Commit", once you commit the below files, are created in the remote repository.

Next step is to add the origin/URL of the git repository, go to the GitHub page you will find the Github URL as shown in the below image.

Copy and paste this in the git bash by using the command $ git remote add origin, now we have connected our local repository to the remote repository.

Verify our repository by using the command $ git remote -v, now you can see our remote repository Flight Application fetch and push message, as shown below.

Now we have to push the changes in your local repository to GitHub by using the command $ git push origin master, once you run this command you will be prompted to enter the username and password

prompted-to-enter-user-name-and -password

Enter the username and password and click on Login, you can see the push message in the git bash, as shown below.

Now go to the GitHub and open your repository, you can see all the keywords and test cases created over there.

Installation of Selenium Library

0 results
Comment / Suggestion Section
Point our Mistakes and Post Your Suggestions