Top Interview Questions
Robot Framework is an open-source automation framework used primarily for test automation and robotic process automation (RPA). It is designed to be simple, readable, and highly extensible, making it popular among both technical and non-technical users. Built with Python, it allows testers, developers, and business analysts to collaborate effectively by writing tests in a human-readable format.
Robot Framework is a keyword-driven testing framework, meaning tests are written using keywords that describe actions instead of traditional programming logic. These keywords can represent anything—from clicking a button in a web application to validating database entries.
The framework is widely used for:
Acceptance testing
End-to-end testing
API testing
Robotic Process Automation (RPA)
Its syntax is easy to understand, even for non-programmers, which makes it a powerful tool for bridging the gap between technical and business teams.
At the heart of Robot Framework is its keyword-driven style. Instead of writing code-heavy scripts, users write test cases using predefined or custom keywords.
Example:
Login To Application
Enter Username user1
Enter Password password123
Click Login Button
This makes test cases:
Easy to read
Easy to maintain
Reusable
Robot Framework uses plain text or tabular formats. Tests can be written in:
.robot files
Plain text
TSV (tab-separated values)
The structure is simple and organized into sections like:
Settings
Variables
Test Cases
Keywords
Robot Framework is highly extensible through libraries. You can integrate it with Python or Java libraries to expand its capabilities.
Popular libraries include:
SeleniumLibrary (for web automation)
RequestsLibrary (for API testing)
DatabaseLibrary (for database validation)
You can also create custom libraries to suit specific needs.
Since it is built on Python, Robot Framework runs on:
Windows
macOS
Linux
This makes it suitable for cross-platform testing environments.
Robot Framework automatically generates detailed reports and logs after execution.
Features include:
HTML reports
Step-by-step execution logs
Screenshots (when integrated with tools like Selenium)
These reports help in debugging and analyzing test results.
Robot Framework integrates with various tools such as:
CI/CD pipelines (Jenkins, GitHub Actions)
Version control systems (Git)
Test management tools
Robot Framework follows a modular architecture:
This includes:
Test cases
Keywords
Variables
Written in .robot files, this is the core input for the framework.
Libraries provide keywords. These can be:
Built-in libraries
External libraries
Custom-developed libraries
The test runner executes test cases and processes the keywords.
After execution, Robot Framework generates:
Report files
Log files
Output XML
The workflow typically looks like this:
Write test cases using keywords
Import required libraries
Execute tests using the Robot command
Analyze reports and logs
Example command:
robot test_suite.robot
Here’s a simple example:
*** Settings ***
Library SeleniumLibrary
*** Test Cases ***
Open Google
Open Browser https://www.google.com chrome
Input Text name=q Robot Framework
Press Keys name=q ENTER
Close Browser
This test:
Opens a browser
Searches for "Robot Framework"
Closes the browser
Its readable syntax makes it beginner-friendly.
Keywords can be reused across multiple test cases.
Being open-source, it has a large and active community.
It supports:
Web testing
API testing
Desktop application testing
RPA tasks
Since it is Python-based, it allows powerful scripting when needed.
Keyword-driven tests can become cumbersome for complex logic.
It may be slower compared to lightweight frameworks.
Requires external libraries for advanced functionality.
Robot Framework is also used for Robotic Process Automation, where repetitive business tasks are automated.
Examples:
Data entry
File processing
Report generation
It can simulate human actions like:
Clicking
Typing
Reading data
Robot Framework is widely used in:
Using SeleniumLibrary to automate browser interactions.
Using RequestsLibrary for REST API validation.
Integrated into CI/CD pipelines for automated testing.
Used by business teams to validate requirements.
| Feature | Robot Framework | Selenium (Raw) | PyTest |
|---|---|---|---|
| Ease of Use | High | Medium | Medium |
| Programming Needed | Low | High | Medium |
| Readability | Very High | Low | Medium |
| Flexibility | Medium | High | High |
To effectively use Robot Framework:
Use meaningful keyword names
Keep test cases small and focused
Reuse keywords wherever possible
Organize test suites logically
Integrate with CI/CD pipelines
Robot Framework continues to grow with:
Increased adoption in RPA
Integration with AI-based testing tools
Better support for cloud-based testing
Its simplicity and flexibility make it a strong choice for modern automation needs.
Robot Framework is a powerful, flexible, and easy-to-use automation framework that simplifies testing and process automation. Its keyword-driven approach, human-readable syntax, and extensibility make it suitable for teams of all skill levels.
Whether you are a beginner in automation or an experienced tester, Robot Framework provides the tools needed to build scalable and maintainable test automation solutions.
Answer:
Robot Framework is an open-source test automation framework used for:
Acceptance testing
Acceptance Test-Driven Development (ATDD)
Robotic Process Automation (RPA)
Keyword-driven testing
Easy syntax (tabular format)
Extensible with Python and Java
Supports libraries like Selenium
π It is widely used for web, API, and desktop testing
Answer:
Keyword-driven testing means writing tests using predefined keywords instead of code.
Open Browser https://google.com chrome
Input Text name=q Robot Framework
Click Button name=btnK
π Here:
Open Browser, Input Text are keywords
Test logic becomes readable and reusable
Answer:
A .robot file typically contains:
*** Settings ***
*** Variables ***
*** Test Cases ***
*** Keywords ***
Settings → Libraries, resources
Variables → Test data
Test Cases → Actual tests
Keywords → Custom reusable steps
Answer:
Libraries provide built-in or external keywords.
SeleniumLibrary → Web automation
BuiltIn → Default keywords
Collections → List/dictionary operations
RequestsLibrary → API testing
π Example:
*** Settings ***
Library SeleniumLibrary
Answer:
SeleniumLibrary is a library used in Robot Framework for web UI automation.
Open browser
Click elements
Handle forms
Wait for elements
π It uses Selenium WebDriver internally
Answer:
Variables store data for reuse.
Scalar → ${name}
List → @{items}
Dictionary → &{data}
${URL} https://google.com
@{LIST} a b c
Answer:
Custom keywords created to reuse logic.
*** Keywords ***
Login To Application
Input Text username admin
Input Text password 1234
Click Button login
π Helps:
Reduce duplication
Improve readability
Answer:
Used to run code before and after tests.
Test Setup / Teardown
Suite Setup / Teardown
Test Setup Open Browser
Test Teardown Close Browser
Answer:
After execution, it generates:
log.html → Detailed execution logs
report.html → Summary report
output.xml → Machine-readable results
π These help in debugging and analysis
Answer:
Running same test with multiple data inputs.
*** Test Cases ***
Login Test
[Template] Login Keyword
user1 pass1
user2 pass2
Answer:
A file used to store reusable:
Keywords
Variables
Resource common.robot
π Helps modularize test cases
Answer:
Locators identify elements on UI.
id
name
xpath
css
Click Element id=login
Input Text xpath=//input[@name='q']
Answer:
Waits ensure elements are loaded before interaction.
Implicit wait
Explicit wait
Wait Until Element Is Visible id=submit
Answer:
Using:
Run Keyword And Ignore Error
Run Keyword And Expect Error
Run Keyword And Ignore Error Click Element id=optional
Answer:
Used for iteration.
FOR ${i} IN RANGE 5
Log ${i}
END
Answer:
Using RequestsLibrary.
Create Session mysession https://api.com
GET On Session mysession /users
Answer:
A collection of test cases.
π A folder with multiple .robot files = test suite
Answer:
You can integrate with tools like:
Jenkins
GitHub Actions
Run tests via command line
Generate reports
Publish results
Answer:
Easy to learn
Readable syntax
Strong community
Supports multiple platforms
Answer:
Slower than pure code frameworks
Limited control compared to Selenium + Python
Debugging can be harder
When asked practical questions:
Explain concept
Give small example
Mention real-world usage
*** Settings ***
Library SeleniumLibrary
*** Variables ***
${URL} https://google.com
*** Test Cases ***
Search Test
Open Browser ${URL} chrome
Input Text name=q Robot Framework
Click Button name=btnK
Close Browser
Robot Framework is an open-source, keyword-driven test automation framework.
Readable syntax (non-programmers can understand)
Supports BDD-style testing
Easy integration with Python libraries
Rich ecosystem (Selenium, API, DB, etc.)
Acceptance testing
Cross-team collaboration (QA + business)
Hybrid automation (UI + API + DB)
Highly complex logic-heavy automation (pure Python better)
Written in .robot files
Contains:
Test cases
Keywords
Variables
Built-in libraries
External libraries (Python-based)
Example:
SeleniumLibrary
RequestsLibrary
Executes tests
Generates logs & reports
log.html
report.html
output.xml
Test Case → Keywords → Library → Execution → Reports
Test Layer
Keyword Layer
Page/Object Layer
Utility Layer
tests/
resources/
keywords/
pages/
variables/
libraries/
configs/
Use Resource files
Create custom keywords
Use external files:
CSV
Excel
JSON
Jenkins / GitHub Actions
Parallel execution
π Keep test cases clean and business-readable, move logic to keywords
Defined in .robot files
*** Keywords ***
Login To App
Input Text username user
Input Text password pass
Click Button login
from robot.api.deco import keyword
@keyword
def add_numbers(a, b):
return int(a) + int(b)
Complex logic
API handling
DB operations
Keep keywords atomic
Avoid long keyword chains
Use meaningful names
Dynamic IDs, changing locators
XPath with contains()
CSS selectors
Explicit waits
Example:
Wait Until Element Is Visible
Selenium via SeleniumLibrary
Separate:
Locators
Actions
Tests
Page file
*** Variables ***
${LOGIN_BUTTON} id=login
Keyword file
Click Login
Click Element ${LOGIN_BUTTON}
Maintainability
Reusability
Reduced duplication
RequestsLibrary
Create Session mysession https://api.example.com
${response}= GET On Session mysession /users
Should Be Equal As Numbers ${response.status_code} 200
Auth tokens
Headers
JSON validation
Pabot
pabot --processes 4 tests/
Shared test data
Environment conflicts
Isolated test data
Independent test cases
JSON
YAML
CSV
USERNAME = "admin"
dev / qa / prod
π Avoid hardcoding
log.html (step-by-step execution)
Automatic on failure
Use Log keyword
Run tests with --loglevel DEBUG
Jenkins
GitHub Actions
Azure DevOps
Checkout code
Install dependencies
Run tests
Publish reports
robot tests/
Modular design
Keyword abstraction
Naming conventions
Code reviews
Duplicate keywords
Hardcoded values
Long test cases
Fix: proper waits, stable locators
Fix: parallel runs (Pabot)
Fix: containerization (Docker)
Fix: isolated datasets
| Feature | Robot Framework | Selenium |
|---|---|---|
| Type | Framework | Library |
| Language | Keyword-driven | Code-driven |
| Ease of use | High | Moderate |
| Flexibility | Medium | High |
UI (SeleniumLibrary)
API (RequestsLibrary)
DB validation
Smoke
Regression
End-to-end
Nightly runs
Parallel execution
Custom reports
Integration with dashboards
Framework design experience
Real-world problem solving
Debugging skills
CI/CD integration
Trade-offs awareness