Sharif Magembe
4 min readMay 14, 2021

OpenMRS Quality Assurance Engineering Using Selenium And Cucumber Automation Tools

OpenMRS Quality assurance Project is working tiresomely to increase test coverage while leveraging the best automation tools like selenium java and cucumber studio

Briefly Selenium is an automation tool for functional testing of web based-application ,and it supports a number of languages like java,

Functional Testing is the type of software that validates the software(openmrs) against functional specifications, ideally the use of functional testing is to test each part of openmrs referenceapplication by providing appropriate input, validation and output functionality, we at the moment don't care about code functionality but rather care about User interface , Quality of APIs, Security and database functionalities

Cucumber on the other hand is a testing approach which supports Behavior driven development(BDD),it explains the behavior of the application workflow in simple English text using gherkin language,

Why we use selenium and Cucumber , Selenium and cucumber are very popular languages and they are being used by a number of organisations across the globe, However ideally we want to be able to integrate selenium and cucumber as cucumber makes it easy to read and understand the application workflow , Cucumber tool is a behavior driven development that bridges the gap between software engineers and business analyst, manual testers and Automation Testers , manual testers and Developers/coders , Cucumber BDD frameworks also benefits the client side to understand the application code flow as it uses Gherkin language in that any one in the organisation can understand the behavior of the software

Note that ,we use java instead of ruby

OpenMRS QA framework depends on referenceapplication distro openmrs contrib-qaframework and Uitest framework

Here we go we will be automating the login screen of referenceapplication using cucumber and selenium, we need by default 4 Files for BDD

1: Feature File: Will be written in Gherkin syntax like When ,And,when which are human Readable ,Namely Login.feature, it should be looking like

2:Steps Definition File: Should be automatically generated from feature file. It will link your feature file with regex to this. So you should call/write some java codes, so this is the where you write the logic and the functionalities of your page which is login, eg how does the user interact with login, what happens when the password is wrong,Here is an example of step definition screenshot starting from scenario outline

3.Page File: Selenium Webdriver codes go here. we normally write our pages in referenceapp distro where all the functionalities that correspond to the step definitions occur from

4.Test Runner File: This file is test suite file. We run all test scenarios with this file for CI/CD integrations/unit tests. So you need to specify your feature file location ,

From here you are able to test your first selenium and cucumber login page if all the requirements are set ,Note that @cucumberOptions include the files definitions of the feature file directory in your project, @cucumber.class is the one that initializes the cucumber, We can as well generate cucumber reports which can be used to see a number of tests with in the system through a number of files like html, json file and xml defined in glue part.

Hope you enjoyed this reading and some description has impacted the future of quality assurance and technical roadmap of openmrs quality assurance support team. Thanks to my mentor Kaweesi Joseph

Thanks Best Regards Magembe sharif Quality Assurance Engineering Fellow

Sharif Magembe
Sharif Magembe

Written by Sharif Magembe

Full stack Software Developer with 3years of experience

Responses (2)