You are using an older browser that might negatively affect how this site is displayed. Please update to a modern browser to have a better experience. Sorry for the inconvenience!

Automating Salesforce Testing with Robot framework

By: Venkata

Automating Salesforce testing with Robot framework


Robot framework is an open-source automation framework, and it is implemented by Selenium with Python. It is executed by Jython (JVM) and Iron Python (.NET).  Robot Framework is an automation framework for acceptance testing and acceptance test-driven development testing.

The Robot framework supports data driven, keyword driven, and table-driven methods


  1. Robot framework supports advanced keyword driven framework
  2. Dynamic variables are used, and scripts and custom keywords are reusable
  3. It supports test libraries including Selenium
  4. It is an open-source framework
  5. It provides simple and powerful test reports

Pre-requisite for Robot framework:

Python should be installed with Selenium Installation, and then the robot framework and RIDE should be installed with python.


Executing Robot framework with python using “robot” scripts. The scripts are executable in the automation frame work system.

RIDE can be open as a windows command as

This is the RIDE editor normal view. Here, we can import files like standard & external library, resource files, variables, Scalar variable, list and dictionary using the add import setting option.


Create a new lead record and convert the lead record; then verify the Lead values are mapped with Accounts, Opportunity and Contacts object fields.


We can import library files and resource in RIDE using setting option.

Robot Framework

RIDE has standard and external library files; so, we can import as per our requirement.

Resource setting method is used to import extra files like reading data from excel action and any other complex method implementation can be developed a code in python file and import it as a resource file.

Step2: Identify and capturing the Web element.

To identify the web elements through inspect/fire path and update the web elements using the scalar variable method.

Adding a scalar variable with web elements

Robot Framework

The scalar variable contains web elements of the Lead, Account, Opportunity and Contacts object. Please see the screenshot below:

Robot Framework

We can use this scalar variable in all test cases inside of same test suite.

Test case creation:

We can prepare test document like functionality and test steps, using setting option.

Robot Framework

Setup and Tear-down:

Tag: Tags are generally more flexible and provide more functionality than documentation, we can tag test cases and run at necessary test execution.

In Robot framework, the test cases are written by two methods:

  1. Work flow test
  2. Data driven test

New User Keyword:

By right clicking test suite, we can create a new user keyword. The keyword should have argument names and clear structure about the test cases.

Below is the example of user keyword method

Salesforce Test Automation

Test Case: By Right clicking the test suite, we can choose the new test case drop down and write the test cases in a tabular syntax method. The test cases are written easily by using this method.

Text view of test cases:

Salesforce Test Automation

Once have completed the test case development, click Save icon on the top window; then, execute the test cases.

Test Execution and Test Results:

After executing the test cases, these three files are generated: Log, Report and XML files. The test results would be very clear and detailed. It generates the compiled report with a step-by-step execution detail.

Among the executed test cases, two test cases passed and other two test cases failed, also the test execution result could be generated in run tab with console

Console window of RIDE

Salesforce Test Automation

Test Log Report:

It is a log report of test execution.

Salesforce Test Automation Framework

Failed Test Log Report:

When executing the test cases, if any issues are identified, they are automatically taken screenshot with a detailed description.

Salesforce Test Automation Framework

Test Report:

Robot framework generated detailed reports about test execution with time duration and status %.

Salesforce Test Automation Framework

Robot framework Advantages:

  1. Less effort to automate the test cases
  2. It supports Continuous Integration and easy integration with other tools
  3. It supports exception handling and test executions are supported by different operating system
  4. Test matrices updated automatically.
  5. Failed test cases can be captured as defect screenshots with detailed descriptions.

Reference link: