Working with REST API using Robot Framework?

Scenario:- How we can automate API calls using Robot Framework?
Robot framework call in Rest API

We can utilize the methods from below 2 libraries:-

We tested the second library in our application, just install the library and we are ready to go.

How to call Javascript/VBS functions in Robot Framework.

Scenario:-How we can call javascript/vbs functions in Robot Framework?
Using the python function to call the VBS file.
VBS function in robot framework

Using the inbuilt Keyword in Selenium2Lib called as "Execute Javascript".
Execute Javascript in Robot

Learn Robot Framework

Reading JSON data in Angular JS (Part-1)

Scenario: - How to fetch JSON data from backend into User Interface (UI) of application using Angular JS?

We have divided our solution approach into 2 parts; in part-1, tutorial we would fetch the data in a straight flow, without thinking about the framework level things.

Reading json data using service

JS File

//Creat app module
var app = angular.module('myApp',[])
//Creating the controller constructor
 //Calling the get method of service 
  $scope.myData =;


html file

<!DOCTYPE html>
<html ng-app="myApp">
  <script type="text/javascript" src="js/angular.min.js"></script>
  <script type="text/javascript" src="js/controllerRead.js"></script>
  <link rel="stylesheet" type="text/css" href="css/family.css">
  <div  ng-controller="familyCtrl">
   <p>Reading JSON data using AngularJS Service component</p> 
     <li ng-repeat="x in">
       {{ x.age + ', ' +  x.role }} 
      House No = {{[0].no}}
       Income = {{myData.income}}



JS File:- it contains the business logic, which uses the get method of the service ($http), to fetch data from JSON, on success it binds data to scope (myData).

JSON File:-It consists of our JSON data. Few points to know for beginners in JSON
HTML File:-Consists of ng-app (bootstrap angular), ng-controller (using this directive to link to controller - controllerRead.js), ng-repeat (to repeat it for all the values of json element) and lastly we use the scope to display the fetched data from JSON.

Importing an library in Robot Framework comes in RED color.

Issue: - We tried adding the Selenium2Libray in robot framework but its shown in red color(in settings) and we are not able to implement any of the keywords.

library comes in red in robot framework

Root cause: - Anything coming in red in settings after importing generally means that particular library is not properly installed.

Let’s check whether we were able to install selenium2library.
Type python in cmd and type "import selenium2library", in our case it would give the error message something call stack error.
We can visualize the same error after importing selenium2library in ride and going to Tools > View in ride.
View log in Robot framework

We found some files were missing like in our case its decorator dependency that RIDE is not able to locate when loading "Selenium2Library"
No module decorator robot framework
Note: - Most of the time it’s some missing files that are not installed which results in libraries name coming in red on adding to RIDE. Like same can happen on importing "ExcelLibrary" or "Database library"

Go ahead and install the missing dependency, in our case its "decorator"
Download the dependency
Open the command prompt to the extracted downloaded file install

And we are done.

Note:- As discussed same solution can be applied to any external library that is coming as red on importing into RIDE inside settings tab.

Learn Robot Framework

New input types in HTML5

Stop managing your time. 
Start managing your focus.

We already discussed the new form elements in HTML5. Today we would highlight the new input types in HTML5. 

How many of them was introduced?
13 New Input Types.

Follow us to learn more .. FbG+,Twitter

Does my browser Supports them?
Check the compatibility chart. If any of the browser does not supports it would be rendered as text type(default type for a input type).


Robot Framework: - Cannot import name XmlElementHandler Error

After upgrading to the latest version of Robot Framework and RIDE and rerunning existing scripts, we were surprised to get the “Cannot import name XmlElementHandler”

Step1:- Try to locate the missing file in robot setup that is installed on the system.
In our case it was XmlElementHandler, after some investigation (by searching the folders of robotframework installation :) ) we located the file :-
Path in our case: - “C:\Python27\Lib\site-packages\(robotframework-version)\robot\result

Step2:- Open the erroneous file (

Step3:- In our case it was empty, so we googled it out to find the latest file
Step4:- Replaced the file and our scripts are up and running :p

Note:- Incase the copied files from robotframework setup location on internet contains some extra character do remove them before running ( in our case [docs] was coming extra)

Learn Robot Framework
Learn Selenium

Robot Framework- Working with Excel Library(Part-3)

After our installation and fetching data from excel we would move towards writing data into excel.
Robot Framework with Excel Library

Scenario:- How to publish robot framework run results into Excel?

We can connect on Fb,G+,Twitter to find what we do next?.

Step1:- Create excel at run time with given heading inside Results folder.(At "Suite Setup")
Step2:- Add test details (at Test Case "Setup") to newly created excel
Step3:- Append the results(pass/fail) to the excel after the run of the Test case in Robot Framework.(at Test Case "Teardown")


*** Settings ***
Suite Setup       Create Result File
Library           ExcelLibrary
Library           OperatingSystem
Library           robot.api.logger
Library           Selenium2Library
Library           String

*** Variables ***
${sFileName}      ${EXECDIR}\\Data\\TestSheet.xls    # DataSheet
${sResultFilePath}    ${EXECDIR}\\Results\\Results    # ResultFile

*** Test Cases ***
TC01_Fetch Data From Excel & Write Results
    [Setup]    Append Test Details to Results File
    Open given Excel file    ${sFileName}
    ${sURL}    Get data from Excel with given column    Data    TC_02    Url
    Log    ${sURL}
    [Teardown]    Publish Test Case Result

*** Keywords ***
Open given Excel file
    [Arguments]    ${sFileName}
    #Check that the given Excel Exists
    ${inputfileStatus}    ${msg}    Run Keyword And Ignore Error    OperatingSystem.File Should Exist    ${sFileName}
    Run Keyword If    "${inputfileStatus}"=="PASS"    info    ${sFileName} Test data file exist    ELSE    Fail    Cannot locate the given Excel file.
    Open Excel    ${sFileName}

Get data from Excel with given column
    [Arguments]    ${sSheetName}    ${sTestCaseNo}    ${sColumnName}
    log    ${sColumnName}
    ${colCount}    Get Column Count    ${sSheetName}
    : FOR    ${y}    IN RANGE    0    ${colCount}
    \    ${header}    Read Cell Data By Coordinates    ${sSheetName}    ${y}    0
    \    #Check if this is the given header
    \    Run Keyword If    "${header}"=="${sColumnName}"    Set Test Variable    ${colNum}    ${y}
    log    ${colNum}
    #Get the total rows in the Sheet
    ${iTotalRows}    ExcelLibrary.Get Row Count    ${sSheetName}
    : FOR    ${iRowNo}    IN RANGE    1    ${iTotalRows}+1
    \    ${TC_Num}    Read Cell Data By Coordinates    ${sSheetName}    0    ${iRowNo}
    \    #Incase TestCase No is same , fetch the data from same row and given column No
    \    ${sSearchedData}    Run Keyword If    "${sTestCaseNo}"=="${TC_Num}"    ExcelLibrary.Read Cell Data By Coordinates    ${sSheetName}    ${colNum}
    \    ...    ${iRowNo}
    \    Run Keyword If    "${sTestCaseNo}"=="${TC_Num}"    Exit For Loop
    [Return]    ${sSearchedData}

Create Result File
    [Documentation]    Create a result file at runtime
    ${sResultFile}    Add TimeStamp to File    ${sResultFilePath}
    #Create Result file at the given location
    Create File    ${sResultFile}
    Append to file    ${sResultFile}    TC_Number\tTC_Desc\tStatus\tComments\n
    Set Global Variable    ${sResultFile}    ${sResultFile}

Add TimeStamp to File
    [Arguments]    ${sResultFilePath}
    [Documentation]    Creating the Name of the Results file based on the current TimeStamp
    ${date}    OperatingSystem.Run    echo %date%
    ${yyyy}    ${mm}    ${dd}    Split String    ${date}    /
    ${time}    OperatingSystem.Run    echo %time%
    ${hh}    ${min}    ${sec}    Split String    ${time}    :
    #Creating TimeStamp
    ${timestamp}    Set Variable    ${mm}${dd}${yyyy}_${hh}${min}
    log    ${timestamp}
    ${sfileName}    Set Variable    ${sResultFilePath}_${timestamp}.xls
    [Return]    ${sfileName}

Append Test Details to Results File
    [Documentation]    Adding Test Case Details to Results File
    #Fetch TC No
    ${sTCNo}    ${sTestDesc}    Split String    ${TESTNAME}    _
    append to file    ${sResultFile}    ${sTCNo}\t${sTestDesc}\t

Publish Test Case Result
    [Documentation]    Adding TC fail/pass results to Result File
    append to file    ${sResultFile}    ${TEST STATUS}\t${TEST MESSAGE}\n
    Close All Browsers

Learn more Robot Framework
Automation Testing using Selenium