A Scalable Selenium-Java Automation Framework for Centralized Template Updates Across Multiple Stores

Time Icon 2 min read

Problem

In our application, multiple stores were managed under a single Admin panel. Each store used a common template, but any change to the template code had to be updated individually for every store. As the number of stores increased, this manual approach became inefficient and difficult to manage.

  • Similar or the same changes that needed to be made to multiple stores were done manually.
  • Template updates were performed store by store.
  • Template updates were to be performed at a particular location in the template. Update the store property according to the store name or ID.
  • Issues faced:
    • High manual effort
    • Increased chances of human errort
    • Inconsistent template updates
    • Inconsistent template updates
    • Risk of missing some stores
    • Significant time consumption for repetitive tasks

Additionally, updating the template using normal element interaction (selecting elements and applying changes) was unreliable due to: Velocity template

  • Dynamic UI elements
  • Hidden or non-interactable components
  • DOM complexity

 

Solution

  • External Store Data Management

    Store IDs and the template content were different every time:

    Store Data was maintained in:

    • Excel files for structured and bulk data
    • TXT files for quick configuration changes

    This allowed easy addition or removal of store data without modifying the automation code.

  • File Reading Implementation
    • Apache POI was used to read store IDs from Excel files.
    • BufferedReader was used to read store IDs from TXT files.
    • Store data was loaded dynamically at runtime, making the solution flexible and scalable.
  • Automation Workflow
    • Log in to the Admin panel
    • Read store IDs from Excel or TXT files
    • Loop through each store ID
    • Navigate to the template configuration section
    • Update the template code
    • Validate successful update
    • Log success or failure for each store
  • Template Update Using JavaScript Executor

    During implementation, it was found that:

    • Template updates did not work reliably using standard element selection and interaction.
    • Some elements were dynamically loaded or hidden, causing automation failures.

    To address this:

    • JavaScript Executor was used to apply template updates directly.

    This approach:

    • Bypassed UI interaction issues
    • Ensured direct and accurate template modification
    • Reduced flakiness and execution failures

    As a result: Template updates became simpler, faster, and more reliable.

 

Results

  • Reduced template update time from hours to minutes
  • Eliminated manual errors and skipped stores
  • Achieved 100% consistency across all stores
  • Improved reliability of template updates
  • Made the solution scalable for future store additions

 

Business Impact (Before and After)

Metrics Before Automation After Automation
Template update time Manual template update for each store; took several hours, depending on the number of stores Automated bulk template update across all stores; completed in minutes
Consistency Across Stores Inconsistent template updates due to manual errors 100% consistent template updates across all stores
Manual Errors Frequent errors such as skipped stores, partial updates, or incorrect changes Human error has been significantly reduced; reliable and validated updates
UI Interaction Reliability Template updates failed due to dynamic or non-interactable elements JavaScript Executor used for direct template updates; stable and reliable execution

Development Timeline

The end-to-end Selenium–Java automation framework was designed and implemented within 2–3 working days, covering external store data ingestion, Admin panel authentication, bulk store iteration, and centralized template updates. The solution efficiently processed dozens of stores in a single execution, where manual updates earlier required repetitive store-by-store effort.

By leveraging Excel and TXT-based store configuration, Apache POI, BufferedReader, and JavaScript Executor, the automation reduced template update time from several hours to just a few minutes per execution, ensuring consistent and reliable updates across all stores. What previously took days of manual effort was now completed in minutes with zero manual intervention

This rapid and scalable delivery demonstrates the framework’s capability to:

  • Quickly adapt to changing store configurations without code changes
  • Automate complex Admin-panel workflows across multiple stores
  • Handle dynamic and non-interactable UI components using JavaScript execution
  • Transform error-prone, repetitive manual operations into a stable, reusable, and scalable automation pipeline

Conclusion

This case study highlights how a well-designed automation solution can eliminate repetitive manual work and improve operational efficiency. By reading store IDs from Excel and TXT files, the solution became flexible and easy to maintain. The use of Apache POI, BufferedReader, and JavaScript Executor ensured reliable and consistent template updates across all stores.

Overall, the solution delivered a scalable, accurate, and business-friendly automation framework that significantly reduced effort, minimized errors, and optimized template management at scale.