<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: kamini mangal</title>
    <description>The latest articles on DEV Community by kamini mangal (@kamini_mangal_1719285e4fa).</description>
    <link>https://dev.to/kamini_mangal_1719285e4fa</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4063978%2Fb1f3023d-31f9-496d-9dc7-0b77e24c4e8f.png</url>
      <title>DEV Community: kamini mangal</title>
      <link>https://dev.to/kamini_mangal_1719285e4fa</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kamini_mangal_1719285e4fa"/>
    <language>en</language>
    <item>
      <title>How I Cut Test Automation Runtime by 70% Using a Custom WebDriver Pool</title>
      <dc:creator>kamini mangal</dc:creator>
      <pubDate>Wed, 05 Aug 2026 12:15:24 +0000</pubDate>
      <link>https://dev.to/kamini_mangal_1719285e4fa/how-i-cut-test-automation-runtime-by-70-using-a-custom-webdriver-pool-2em1</link>
      <guid>https://dev.to/kamini_mangal_1719285e4fa/how-i-cut-test-automation-runtime-by-70-using-a-custom-webdriver-pool-2em1</guid>
      <description>&lt;p&gt;When I joined PCLnXAI as a Technical Product Manager, one of my first big builds was &lt;strong&gt;AutoFlow&lt;/strong&gt; — an enterprise UI test automation platform for Oracle Fusion Cloud, covering 25+ automated end-to-end flows across modules like Accounts Payable, Accounts Receivable, General Ledger, Procurement, and Fixed Assets.&lt;/p&gt;

&lt;p&gt;The stack: Python, Flask, and Selenium WebDriver.&lt;/p&gt;

&lt;p&gt;Here's the problem we ran into, and how we solved it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem: cold starts were killing us
&lt;/h2&gt;

&lt;p&gt;Every time a test flow spun up a browser session, we paid a real cost:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Launching a fresh Edge WebDriver instance&lt;/li&gt;
&lt;li&gt;Waiting for it to fully initialize&lt;/li&gt;
&lt;li&gt;Only then starting the actual test&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Multiply that by dozens of concurrent flows, and cold-start overhead alone was eating 2–5 seconds &lt;em&gt;per test&lt;/em&gt;, before any real work happened.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fix #1: A pre-warmed DriverPool
&lt;/h2&gt;

&lt;p&gt;Instead of spinning up a new WebDriver instance per test, I built a custom &lt;code&gt;DriverPool&lt;/code&gt; that keeps a set of pre-warmed Edge WebDriver instances ready to go. When a test needs a browser, it borrows one from the pool instead of paying the cold-start cost every time.&lt;/p&gt;

&lt;p&gt;Combined with &lt;code&gt;ThreadPoolExecutor&lt;/code&gt;-based request parallelism, this let multiple flows run concurrently without duplicating startup overhead.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fix #2: Batched log flushing
&lt;/h2&gt;

&lt;p&gt;Writing logs line-by-line during high-concurrency test runs created I/O contention. Batching log writes instead of flushing on every line reduced that overhead significantly, especially under concurrent load.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fix #3: Real-time log streaming without polling
&lt;/h2&gt;

&lt;p&gt;We wanted the UI to show &lt;em&gt;live&lt;/em&gt; execution logs as tests ran — not logs that show up only after the test finishes. The naive approach is polling, but that's wasteful and laggy.&lt;/p&gt;

&lt;p&gt;Instead, I built a low-latency log streaming service using &lt;strong&gt;WebSockets (Flask-Sock)&lt;/strong&gt; and &lt;strong&gt;Gevent greenlets&lt;/strong&gt; for non-blocking async I/O. Logs get fanned out to the UI per &lt;code&gt;execution_id&lt;/code&gt;, in real time, without a single polling request.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fix #4: Scheduling with APScheduler
&lt;/h2&gt;

&lt;p&gt;To run flows on a schedule (nightly regression, pre-cutover validation, etc.) without a separate cron infrastructure, I used &lt;strong&gt;APScheduler&lt;/strong&gt; directly inside the Flask app — simple, in-process, and easy to manage alongside the rest of the platform.&lt;/p&gt;

&lt;h2&gt;
  
  
  The result
&lt;/h2&gt;

&lt;p&gt;Together, these changes cut per-test cold-start time by 2–5 seconds and reduced overall pipeline runtime by roughly &lt;strong&gt;70%&lt;/strong&gt; across concurrent workflows.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I'd explore next
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Moving the DriverPool to support horizontal scaling across multiple machines&lt;/li&gt;
&lt;li&gt;Adding circuit-breaker logic for flaky flows instead of blind retries&lt;/li&gt;
&lt;li&gt;Exporing headless execution where UI verification isn't strictly required&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;If you're building test automation infrastructure and have hit similar cold-start or concurrency bottlenecks, I'd love to hear how you approached it. 👇&lt;/p&gt;

</description>
      <category>python</category>
      <category>automation</category>
      <category>webdev</category>
      <category>testing</category>
    </item>
  </channel>
</rss>
