Create new file in project with .robot extension.
Robot file contains below sections:
- Setting
- Variables
- Keywords
- Test Cases
In setting section all imports can be defined. In variables section, Test data should be defined. In Keywords section, All operations can be defined by calling predefined keywords. In Test Cases section, All operations can be performed by calling user defined keywords.
Here is the sample script to login into mercury website:
*** Setting ***
Library SeleniumLibrary
*** Variables ***
${UserName} amitb
${Password} amitb
*** Keywords ***
Open Mercury Tours with Chrome
Open Browser http://newtours.demoaut.com/ chrome
Wait Until Page Contains Registered users can sign-in
Login to Mercury Tours
Input Text name:userName ${UserName}
Input Text name:password ${Password}
Click Element name:login
*** Test Cases ***
TestCase1: Login Mercury Tours
[Documentation] This test case is to login to mercury tour website
[Tags] Smoke,Sanity
[Setup]
Open Mercury Tours with Chrome
Login to Mercury Tours
[Teardown]
Close Browser