Robot Framework Open Close Browser Example (2024)
In this tutorial, we'll show you how to open and close browser in robot framework.
Project Structure
Create Result Folder
Create result
folder. Result folder will have log, report file.
Take a look at our suggested posts:
Create Tests Folder
Create tests
folder, which will contains all the test to be executed.
Create TechGeekNext.robot File
Create TechGeekNext.robot
file under Tests folder and include below code to open the
browser and once open close the browser.
*** Settings ***
Documentation This is test script
Library SeleniumLibrary
*** Variables ***
*** Test Cases ***
- Test TechGeekNext Site
[Documentation] Test1- Open TechGeekNext in browser
[Tags] Smoke
#Open Browser https://www.techgeeknext.com/ chrome
Open Browser https://www.techgeeknext.com/ ie
Close Browser
*** Keywords ***
Run the Test Program
Use the below command to execute the test program.
robot -d results tests/TechGeekNext.robot
Robot Framework Reports
It generate reports(report.html
) of test program under result folder.
Robot Framework Logs
It generate logs(log.html
) of test program under result folder.