CI/CD & Industry Usage in Robot Framework
Welcome to Phase 7 of Robot Framework Tutorial Series. In this tutorial, we will learn how Robot Framework is used in real-time industry projects with CI/CD tools.
Modern automation frameworks are incomplete without CI/CD integration. Companies use tools like Git, GitHub, Jenkins, Bitbucket and GitHub Actions for continuous automation execution.
Topics Covered
- Git & GitHub
- Jenkins Integration
- Bitbucket
- GitHub Actions
- CI/CD Concepts
What is CI/CD?
CI/CD stands for:
- CI → Continuous Integration
- CD → Continuous Delivery / Continuous Deployment
Simple Meaning of CI/CD
Whenever developers push code to repository:
- Automation execution starts automatically
- Tests execute automatically
- Reports are generated automatically
- Team gets execution results automatically
Benefits of CI/CD
- Faster testing
- Automatic execution
- Early bug detection
- Reduced manual effort
- Supports Agile methodology
26. Git & GitHub
Git is a version control system used to manage code changes. GitHub is a cloud platform used to store Git repositories.
Why Git is Important for Automation Testers?
- Code backup
- Version management
- Team collaboration
- Pull request management
- Code review support
Install Git
Download Git from:
https://git-scm.com/downloads
Verify Git Installation
git --version
Initialize Git Repository
git init
Check Git Status
git status
Add Files to Git
git add .
Commit Changes
git commit -m "Initial framework commit"
Create GitHub Repository
Create repository on:
https://github.com
Push Code to GitHub
git remote add origin https://github.com/username/project.git git push -u origin main
Take Latest Pull
git pull
Create New Branch
git checkout -b feature-login
Merge Branch
git merge feature-login
Common Git Commands
| Command | Purpose |
|---|---|
| git init | Create repository |
| git status | Check file status |
| git add . | Add files |
| git commit | Save changes |
| git push | Upload code |
| git pull | Download latest code |
GitHub Pull Request (PR)
Pull Request is used for:
- Code review
- Team approval
- Safe code merging
Real-Time Git Flow
Create Branch
↓
Write Automation Code
↓
Commit Changes
↓
Push Branch
↓
Raise Pull Request
↓
Code Review
↓
Merge Code
27. Jenkins Integration
Jenkins is one of the most popular CI/CD tools used in automation testing.
It helps automate:
- Test execution
- Scheduled execution
- Report generation
- Email notifications
Why Jenkins is Important?
- Automatic execution
- Supports pipelines
- Easy scheduling
- Industry standard tool
Install Jenkins
Download Jenkins from:
https://www.jenkins.io/download/
Start Jenkins
After installation, Jenkins usually starts on:
http://localhost:8080
Create Jenkins Job
Steps
- Open Jenkins Dashboard
- Click "New Item"
- Create Freestyle Project
- Add Robot Framework execution command
Robot Framework Jenkins Build Command
robot tests/
Install Robot Framework Plugin in Jenkins
Install:
- Robot Framework Plugin
This plugin helps publish Robot Framework reports directly in Jenkins.
Configure Robot Reports in Jenkins
Add post-build action:
output.xml log.html report.html
Scheduled Execution Example
Jenkins supports cron scheduling.
Run Daily at 10 PM
0 22 * * *
Jenkins Pipeline Example
pipeline {
agent any
stages {
stage('Checkout') {
steps {
git 'https://github.com/username/project.git'
}
}
stage('Run Automation') {
steps {
bat 'robot tests/'
}
}
}
}
Advantages of Jenkins Integration
- Automatic test execution
- Continuous testing
- Real-time reporting
- Email notification support
28. Bitbucket / GitHub Actions
Bitbucket and GitHub Actions are modern CI/CD solutions used for automation execution directly from repository.
What is GitHub Actions?
GitHub Actions allows automation workflows directly inside GitHub repository.
Create GitHub Actions Workflow
Create folder:
.github/workflows/
Create Workflow File
Example:
robotframework.yml
GitHub Actions YAML Example
name: Robot Framework Automation
on:
push:
branches:
- main
jobs:
robot-test:
runs-on: windows-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install Dependencies
run: |
pip install robotframework
pip install robotframework-seleniumlibrary
- name: Run Robot Tests
run: |
robot tests/
How GitHub Actions Works?
- Developer pushes code
- Workflow starts automatically
- Dependencies install automatically
- Robot Framework tests execute
- Results appear in GitHub
What is Bitbucket?
Bitbucket is another Git repository hosting platform similar to GitHub.
Bitbucket Pipeline Example
pipelines:
default:
- step:
name: Run Robot Tests
image: python:3.12
script:
- pip install robotframework
- robot tests/
Advantages of GitHub Actions & Bitbucket Pipelines
- No separate CI server required
- Easy integration
- Cloud execution support
- Automatic execution
Real-Time Industry Automation Flow
Developer Pushes Code
↓
GitHub / Bitbucket Repository
↓
CI/CD Trigger Starts
↓
Jenkins / GitHub Actions Executes
↓
Robot Framework Automation Runs
↓
Reports Generated
↓
Team Receives Results
Best Practices for CI/CD Automation
- Keep test cases independent
- Use proper folder structure
- Store secrets securely
- Use reusable pipelines
- Generate proper reports
Conclusion
In this tutorial, we learned:
- Git & GitHub
- Jenkins Integration
- Bitbucket
- GitHub Actions
- CI/CD Concepts
CI/CD integration is one of the most important skills for automation testers. Most companies use Jenkins, GitHub or Bitbucket pipelines for continuous automation execution.
Frequently Asked Questions (FAQ)
Why is Git important for automation testers?
Git helps manage automation code, version control and team collaboration.
What is Jenkins used for?
Jenkins is used for continuous integration and automatic automation execution.
What is GitHub Actions?
GitHub Actions is a CI/CD feature inside GitHub for automatic workflow execution.
Can Robot Framework run in CI/CD pipeline?
Yes, Robot Framework supports Jenkins, GitHub Actions, Bitbucket Pipelines and other CI/CD tools.
No comments:
Post a Comment