Case Study > Technology > Selenium Grid with Azure Kubernetes Services
Selenium Grid with Azure Kubernetes Services
Dec 05 2024 |10 min read
Problem Statement

Client reached out with a recurring issue: the automation testing time was consistently exceeding the allocated window as the test suite expanded with each release. They requested a solution to reduce execution time without compromising testing quality.

Client Information

Client is one of the largest US-based fintech companies, providing innovative financial solutions to institutions, financial professionals, and individuals worldwide.

Key Challenges

Executing all automated UI tests in single series or on multiple machines operating independently led to performance bottlenecks and reduced testing efficiency.

  • Scalability: Managing multiple Selenium nodes manually was time-consuming and error prone.
  • Resource Utilization: Knowing exact number of nodes/machines needed to run any given number of tests at given point of time to efficiently utilize all available resources was a challenge.
  • Reliability: The existing grid setup faced challenges with occasional downtime and inconsistent performance, which affected test reliability and consistency.
Approach

Our objective was to execute thousands of tests concurrently to significantly reduce the overall execution time. This needed to be achieved while ensuring efficient use of resources. By optimizing resource utilization, we aimed to enhance testing performance and cost-effectiveness.

To address this, we implemented Selenium grid on Azure Kubernetes. The strategy was to efficiently up-scale or de-scale the resources based on numbers of tests running.

  • Assessment of Current Infrastructure and requirement: First assessment that included gathering information regarding different types of browsers that we run tests on, typical/average number of tests running in Selenium projects, numbers of threads etc.

  • Implementation with Azure Kubernetes Services (AKS):

  1. Setup and configured an AKS cluster with the necessary settings like Preset Configuration, Node count, Automatic scaling and enabling virtual node creation.
  2. Deployed hub and nodes in form of pods in the cluster node along with service that act as load balancer as well as expose the hub to external network.
  • Dynamic Scaling: Implemented Kubernetes Horizontal Pod Autoscaler (HPA) to automatically scale Selenium Nodes based on certain system parameters defining the min and max nodes.

  • Load Balancing: Configured Kubernetes Ingress Controller for load balancing to distribute the test load evenly across nodes.

  • Code Integration:

  1. Added remote URL address that we get after exposing the hub using service and added all the needed browser options.
  2. Configured the test thread count that would work as the requirement for HPA service running in AKS cluster.
Benefits
  • Enhanced Scalability: AKS allowed for seamless scaling of Selenium Nodes, ensuring optimal resource utilization and handling peak loads efficiently.
  • Cost Efficiency: Dynamic scaling and pay-as-you-go model reduced costs associated with underutilized resources.
  • Faster Test Execution: Parallel test execution across multiple nodes significantly reduced test execution time by more than 60%.
  • Improved Reliability: High availability and fault tolerance were achieved through Kubernetes' inherent capabilities.
  • Reduced Maintenance Overhead: Automated deployments and updates minimized manual intervention and maintenance efforts.
Conclusion

By leveraging Azure Kubernetes Services for Selenium Grid, we successfully addressed the scalability and resource management challenges. The solution provided a robust, cost-effective, and automated approach to manage Selenium Grid, resulting in enhanced testing efficiency and reliability.

Kriti Jha

Kriti Jha

Case Studies you may like

There are no more case studies for this cateory.