How to transition from Manual to Automation Testing

Vedashree Paranjape
6 min readOct 22, 2023

--

(Getting started with Test Automation using Robot Framework)

I often get this question from Manual testers that they want to step into Automation but are not sure where to start from. Usually manual testers don’t have much exposure to coding and it is bit challenging to transition from manual to automation mindset. Here's a detailed guide for anyone who wants to test the waters of the Automation World and get your brain to start swimming in the automation river!

By the end of this blog you will have written and executed your first automation script, so let’s get started!

Let’s first understand what is the end goal we are trying to achieve by doing automation.

  1. Reduce manual testing efforts
  2. Reduce Time To Market
  3. Improve product quality (ofcourse!)

Before starting let me put out a Disclaimer: To achieve 100% automation is a pure myth. You will need some % of manual testing along with automation in order to deliver a successful project.

What are we achieving?

Image from Browserstack

A picture is worth a thousand words!

If you are new to testing this might seem overwhelming but let's take baby steps first.

Automation can be done for any type of testing, but our test automation journey begins with Functional Test Automation.

The Unit and Integration tests are usually done by the developers so don't worry about it for now.

System testing is the one where manual testers test the UI of the application from end user’s perspective which is black box testing. There are 2 parts to manual testing:

  1. Actions: Perform the taps and clicks to execute the user journey
  2. Validations: After performing taps and clicks checking if the expected UI elements are appearing on the screen

After performing the above 2 parts the tester marks the test case as pass or fail based on the result of validations.

Now to reduce manual efforts we need to simulate these actions and add validations through our script and generate a report where the testcase is automatically marked Pass or Fail based on outcome of the script.

If you search on the internet for automation testing tools you will get plethora of tools which use different languages, frameworks and softwares.

Traditionally the most common language among automation testers was Java. Now for a non programmer, learning Java itself might become a roadblock to enter into test automation and most of you will give up on it just by the idea of having to learn all the syntax, jargons, abbreviations of a new language. But we need to stop reinventing the wheel and start embracing the newer, better, easier methods of test automation. And the answer is Robot Framework! If you want to know why read it here:

This guide will get you started with Robot Framework.

Where to automate?

The application which we are testing could be on many different platforms such as:

  1. Web Browser
  2. Android App
  3. iOS App
  4. Android TV App
  5. Apple TV App
  6. Smart TV App

Where to start?

Start with browser.

What to automate?

We will automate the below scenario for official selenium website to test whether user is able to navigate to the Documentation page and whether the ‘Writing your first Selenium script’ text is available on the page.

Summary: Verify documentation page of selenium website is loading successfully and ‘Writing your first Selenium script’ text is available on the page.

Steps:

  1. Launch Chrome browser
  2. Open the Selenium.dev website
  3. Navigate to Documentation Page
  4. Verify if ‘Writing your first Selenium script’ text is available on the page

Expected Result: Documentation Page of Selenium website should load successfully and show ‘Writing your first Selenium script’ text

How to automate?

When the above scenario is tested manually the clicks on the computer are done manually and the validation is done by observing the page manually for the expected outcome.

To replace the manual clicks and observations how will the script identify the objects or elements that are supposed to load on the web page?

Using locators.

Locators are the unique identifiers for each UI element.

For automation the most crucial part is identifying and creating unique locators for each UI element. To learn more about it you can refer the selenium documentation here. There are multiple ways to access the same element using different locator strategy. Master the art of creating unique and robust locators and you will be unstoppable.

Good logic + excellent locators knowledge + “Can Do” mindset is the secret sauce to becoming a great automation engineer!

Let’s Automate.

Here is where just reading part ends and you start doing the work alongside.

What you will need:

  1. Windows/Mac computer
  2. Internet connection
  3. Curious mind with exploring mode set to “ON”

We will be using Selenium + Robot for browser automation. Highly recommend to read the documentation first to get an overview of what is Selenium, Robot Framework and how it works before going ahead.

Setup:

  1. Install python: https://www.python.org/downloads/
  2. Add python to PATH: https://realpython.com/add-python-to-path/
    (While installing python if you select the option to add python to PATH then this step is not needed)
  3. Install Robot framework and Selenium Library:
    Open command prompt as admin and run commands:
    pip install robotframework
    pip install robotframework-seleniumlibrary
  4. Download chromedriver for the version of Chrome browser you are using and save it in location added in PATH: https://chromedriver.chromium.org/downloads

To automate anything first you need to manually perform each step and start creating locators for each element you want to validate and interact with. In below 10 steps you will have executed your first script!

  1. Open Chrome browser
  2. Open the website https://www.selenium.dev/
  3. Right click on Documentation and click on inspect and it will open the chrome DevTools
  4. For this example we will use text to create xpath for the Documentation element so the locator which we will use is xpath which is:
    //*[text()=”Documentation”]
  5. Copy this locator and search it in the DevTools> Elements section
  6. The Documentation element will get highlighted and that's how you know that the xpath which you have created is correct. Also it should show only 1 result (in image we can see “1 of 1”). If it shows “1 of 3” then it means the locator is not unique and there are 3 elements with same locator on the webpage. There are other ways to handle such scenarios which you will learn eventually.

7. Similarly create xpaths or locators for other elements and write the code.

8. Below is a simple reference code for you to get started. Refer the Robot framework and Selenium Library documentation to know more about the keywords used.

9. Save it with .robot extension (eg. sample.robot), open command prompt (Windows) or Terminal (Mac) at location where the sample.robot file is located and run command: robot sample.robot and the script will get executed.

10. The script will launch chrome browser and perform all the steps mentioned in the “What to automate” section, perform validations and generate a beautiful report with all required details of the test (without any additional reporting plugin or tool!).

sample.robot :

*** Settings ***
Library SeleniumLibrary implicit_wait=10 run_on_failure=Capture Page Screenshot
*** Test Cases ***
TC1: Selenium Test
Open Browser https://www.selenium.dev/ Chrome
Maximize Browser Window
Click Element //*[text()="Documentation"]
Wait Until Page Contains Element //*[normalize-space()='Writing your first Selenium script']
Close Browser

Execution Log/Report file:

Notice that by using Robot instead of Java we have removed the biggest obstacle to start automation which is learning a new language and doing a complex setup of framework and plugins as Robot has keywords written in plain English and has the EASIEST syntax and setup.

Happy Learning!

--

--