A Story of powering automation tests with Selenium Object Repository

In this story, we want to explain why our organization has invested in developing its own Object Repository which will be illustrated by an actual case bellow. Importantly, you can download an Object Repository from our site. For our clients, OR is a free source code with our support.

Selenium, nowadays, becomes a powerful test framework and libraries in which we can leverage it into our automation projects without paying any cost. Many organizations have invested time and money in developing their own test framework and Selenium is one of the best choices because they trust Selenium’s power, extension and support. Although Selenium’s value is obvious, from our experience, the Selenium works more effectively if it facilitates a set of objects and properties which we call as an Object Repository (OR). A complete OR allows test engineers to recognize the objects and work with it easily. Using OR, the test engineers are able to quickly and easily manage their scripts when there are unexpected changes in application objects. In the programming perspective, OR could make our codes more “object-oriented”. You can see an example below, which is an Original syntax without OR.

And another sample of new syntax with more Object Oriented by using MeU’s OR

Because we understand that OR is very important to our clients, we decide to establish a mission to building our own OR with our hands-on experienced team which have worked many years with Selenium & Test Framework Development. We started with designing a high level architecture which composites two elements: one add-on (plug-in, or extension) parts in Web Browser (Chrome) which is called “object agent” and another plug-in for coding editor (Eclipse) which is called as “object manager”. You can see the high level architecture from the picture below

While the object agent is missioned to locate, detect or re-learn the objects, the object manager provides a range of functions to manage all objects which are placed into the repository. Our OR not only allows you to work with the objects easier but also help you save time to update your test scripts when there are unexpected changes in the application objects. Following is an actual case with Our OR:

Application Under Automation Test
This application is an online retailer and a prominent cloud services provider. The company was originally a book seller but has expanded to sell a wide variety of consumer goods and digital media as well as its own electronic devices

Automation Test Objectives

  • To gain 70% of test automation coverage which is measured by number of manual test cases automated per total of manual test
  • To gain ease of test script maintenance. Test scripts are written in Object Oriented, no duplication
  • To complete all automation tests within 10 weeks

Technology Stack

  • Selenium Web Driver version 3.0
  • MeU’s Object Repository
  • Jenkin
  • PhantomJS

MeU Automation Approach

  • Assessed automatable: Our teams started to assess a number of test-cases and application features which were able to be automated. Our team identified these candidates as backlog items.
  • Prioritized automation backlog: Workwith client’s representative to decide priorities for each backlog item. Decisions is based on (1)Importance (urgency) of having these test cases automated; (2) How fast (cost, technology/ technical constraints) to automate these items.
  • Designed a simple framework: The framework simply was to organize test scripts, objects, test data, test reports and test results. The framework was using Our OR with its structure as this image
  • Initiated test velocity of our automation: we quickly ran 1-week sprint to automate about 50 test-cases.
  • Executed automation: performed our scripting with a given number of test cases identified at each sprint. Common tests were designed for reuse purposes and avoid code duplications. Our OR was maximize used to create test scripts more easily readable and OO. Below is a fragment of our scripts with using OR as well as a demonstration about how well Our OR facilitated our test engineers in their performance

Test script with MeU’s OR

Object Manager plug-in with Eclipse

Learn & Locate Web Object with Agent