Notice: Use of undefined constant REQUEST_URI - assumed 'REQUEST_URI' in /home/bihariban/public_html/qatestinghelp_com/wp-content/themes/grania/functions.php on line 73 Robot Framework: Write First Test Case - QATestingHelp
Automation TestingRobot

Robot Framework: Write First Test Case

Robot Framework- Write First Test Case

To Write First Test Cases in Robot Framework we need to know some basic Stuff.

*** Settings ***

*** Variables ***

*** Test Cases ***

*** Keywords ***

*** Settings ***   –  Under settings we will import required library using  Library keyword and can import any resource using Resource keyword.

Example –

*** Variables ***  –  Under variables we will define our variables using ${variable name} 

Example –

*** Test Cases *** – Under Test Cases, we will write our Automation Test Cases.

Example –

*** Keywords *** – Under the Keywords section, we will write the user-defined keywords.

Example –

Now, Move further for creating project structure we must remember some basic points.

  • Create a Robot file
  • Create Sections
  • Define Libraries
  • Define Variables
  • Write Test Cases to Start and Close Browser.

Create a Robot File with .robot extension.

Create Sections contains four sections.

Now, We need to import selenium library under Settings and need to create a variable under variables and under Test cases, we will write the test case to open the browser.

For executing the above code in Pycharm, Just click on Terminal tab at the bottom of Pycharm.

and go to the location and type robot filename.robot and press Enter. Please make sure that you have already placed chrome driver .exe file in Python Scripts folder. Download Chrome driver exe from here and firefox driver exe from here .

For closing the browser find below code.

Leave a reply

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