Automation: Driving fast and reliable application testing - Altimetrik
Background
A large pharmaceutical company had spun off a standalone entity. To facilitate the transition, the functionality of four applications specific to the standalone entity had to be validated in the new environment.
An automated testing approach was adopted, utilizing a Java Selenium-based framework with Cucumber-TestNG for test case definition and execution and Extent Reports for comprehensive test execution reporting.
Pain Point
Over time, applications are fine-tuned to run smoothly in complex ecosystems. They build dependencies on platforms, databases, networks, storage, management tools, plug-ins, devices, and backup processes. However, when a business transitions into separate entities, the applications find themselves in a new environment.
In their new environment, the applications need to be tested as their performance could be impacted by a change in their configurations or their dependencies. Testing ensures functionality is maintained, mitigating the risk of operational disruption. Automation is the only reliable way to execute extensive testing for functionality, input and output reliability (reduce errors), system response, user experience, and scalability.
Key Objectives
Faster validation of apps
For manual regression it was 4 hours/app (16 hours for 4 apps). Automation of regression cases reduced to 1 hour of set up and 20 minutes of execution for all 4 apps.
Reduce errors
Historically, sampling was used for manual regression to verify functionality. Automation covers 100% scenarios, reducing the possibility of error from 95% to 0.5%.
Scalability and inclusion of additional apps
Identifying repeated scenarios and feature of applications to design reusable components reduced the effort of redesign and implementation and eliminated 60% of duplicate efforts.
Solution
Altimetrik implemented a special test framework designed to deliver scalability and effectiveness:
Unified Framework
All four applications were integrated into a single framework. This enabled centralized test script management and execution, contributing to scalability and ease of maintenance.
Page Factory Implementation
A page factory pattern facilitated centralized management of page objects specific to each application. This improved script readability and maintenance and enabled the easy identification and utilization of distinct page objects.
Maven Framework
Maven was employed for dependency management, simplifying the addition or removal of plugins and software components. The framework's built-in organization mechanism further eased folder and file management.
Utility Features
A common class containing reusable methods reduced scripting complexity. This improved the readability of step definition scripts and resulted in fewer lines of code. A shared utility class served all applications, enhancing the usability and extensibility of utility methods.
Property Files
The use of property files played a dual role in maintaining configurations and storing test data separately. A common configuration file and individual application-specific test data files were used, minimizing the risk of manipulation and enhancing file-related performance.
Cucumber
The adoption of Cucumber allowed test cases to be written in English Gherkin language, ensuring clarity and understanding for business users. This feature streamlined test execution and facilitated the step-by-step implementation of test scripts.
Extent Reports
Integration with Extent Reports provided visually appealing reports with embedded error screenshots. This enriched the test execution experience and helped users identify and understand defective areas.
Utility Extended Methods
The framework provided an array of utility extended methods, including JavaScript calls, synchronization mechanisms, multiple browser configuration options, parallel testing capabilities, Excel file interaction, and the ability to capture defect page screenshots. Additionally, a rerun option for failed tests was available.
The scenarios covered by the framework included:
- Applicability for all UI testing and Excel validation-based scenarios
- Count validation between source and target scenarios
- Data validation between source and target in UI application
- Functionality-based scenarios (e.g., Switch button, Filter validation, etc.)
- Extensibility to API and database automation6. Extensibility to BI reports testing
The Outcomes
Efficiency
Reduced the time required for testing, allowing faster validation of the standalone entity's applications.
Consistency
The standardized framework enabled uniform testing processes, reducing human errors.
ScalabilityThe unified framework and the centralization of methods and resources facilitated scalability, enabling the inclusion of additional applications if needed.
Clarity
The use of Cucumber and Extent Reports provided comprehensive and clear test case reports in a business-friendly language, enhancing communication between stakeholders.
Risk Mitigation
By identifying defects and issues early in the transition process, the framework mitigated operational disruptions and potential financial losses.