54% of software defects in production are caused by human error during testing. Traditional RPA (Robotic Process Automation) is brittle. It breaks when the UI changes54% of software defects in production are caused by human error during testing. Traditional RPA (Robotic Process Automation) is brittle. It breaks when the UI changes

Building a Self-Healing Web Tester with AI Agents and Combinatorial Logic

54% of software defects in production are caused by human error during testing.

If you are a QA Engineer or a Full Stack Developer, you know the pain of Web UI Testing. You spend days writing Selenium or Playwright scripts, targeting specific div IDs and XPath selectors. Then, a frontend developer changes a CSS class, and your entire test suite turns red.

Traditional RPA (Robotic Process Automation) is brittle. It breaks when the UI changes. It’s strictly rule-based.

In this engineering guide, based on research from Fujitsu’s Social Infrastructure Division, we are going to build a "Next-Gen" Testing Pipeline. We will move away from brittle scripts and move toward Autonomous AI Agents.

We will combine Combinatorial Parameter Generation (to ensure we test every edge case) with AI Agents (using tools like browser-use) that "see" the website like a human, making your tests immune to UI changes.

The Architecture: The Agentic Test Loop

We are building a system that doesn't just "click coordinates"; it understands intent.

The Pipeline:

  1. Source Analysis: Extract parameters from the code/specifications.

  2. Combinatorial Engine: Generate the minimum set of test cases to cover all logic paths.

  3. The Agent: An LLM-driven browser controller that executes the test.

  4. The Judge: An AI validator that checks if the output matches the expectation.

Phase 1: The Combinatorial Engine (Smart Pattern Generation)

A common mistake in testing is testing everything (too slow) or testing randomly (misses bugs). The research suggests analyzing source code to generate an Exhaustive Parameter Table.

We need to cover the "All-Pairs" (pairwise) combinations of settings to catch interaction bugs.

**The Logic: \ If you have 3 settings:

  • Theme: [Dark, Light]
  • Notifications: [Email, SMS, Push]
  • Role: [Admin, User]

Testing every combination = 2×3×2=122×3×2=12 tests. \n Pairwise testing can reduce this to ~6 tests while catching 90%+ of defects.

**Python Implementation: \ We can use the allpairspy library to generate this matrix automatically.

from allpairspy import AllPairs # Parameters extracted from the Web UI Source Code parameters = [ ["Dark", "Light"], ["Email", "SMS", "Push"], ["Admin", "User"] ] print("PAIRWISE TEST CASES:") for i, pairs in enumerate(AllPairs(parameters)): print(f"Case {i}: Theme={pairs[0]}, Notify={pairs[1]}, Role={pairs[2]}") # Output: # Case 0: Theme=Dark, Notify=Email, Role=Admin # Case 1: Theme=Light, Notify=SMS, Role=Admin # ... (Optimized list)

Phase 2: The AI Agent (Without Selenium)

This is the game-changer. Instead of writing driver.find_element(By.ID, "submit-btn").click(), we give an AI agent a high-level instruction.

The research highlights the use of "Browser Use," an emerging class of AI agents that control headless browsers.

Why this works:

  • If the "Submit" button changes from  to 
    , Selenium fails.
  • The AI Agent sees a visual element labeled "Submit" and clicks it, regardless of the underlying HTML.

The Implementation

We will use Python with a library like langchain and playwright (simulating the browser-use concept) to build an agent that accepts the parameters from Phase 1.

from langchain.chat_models import ChatOpenAI from browser_use import Agent import asyncio async def run_ai_test(theme, notify, role): # 1. Construct the Natural Language Instruction instruction = f""" Go to 'http://localhost:3000/settings'. Log in as a '{role}'. Change the Theme to '{theme}'. Set Notifications to '{notify}'. Click 'Save'. Verify that the 'Success' toast message appears. """ # 2. Initialize the Agent agent = Agent( task=instruction, llm=ChatOpenAI(model="gpt-4-vision-preview"), ) # 3. Execute history = await agent.run() # 4. Return result return history.is_successful() # Run a test case from Phase 1 asyncio.run(run_ai_test("Dark", "SMS", "Admin"))

Phase 3: The "Past Failure" Feedback Loop (RAG)

The paper notes that 54% of defects are human error—often repeating past mistakes. To fix this, we inject "Past Failure Knowledge" into the Agent.

We create a lightweight RAG (Retrieval-Augmented Generation) system. Before generating the test plan, the system checks a vector database of previous bug reports.

The Workflow:

  1. Ingest: Index old Jira tickets/Bug reports into a Vector DB.
  2. Retrieve: When testing the "Settings Page," retrieve bugs related to "Settings."
  3. Inject: Add a constraint to the Agent's prompt.

Modified Prompt Logic:

# Retrieved Context: "Bug #402: Saving settings fails when username contains emoji." enhanced_instruction = f""" {base_instruction} IMPORTANT: Based on past failure #402, please also test changing the username to 'User😊' before saving to ensure the app does not crash. """

The ROI: Why Switch?

The research indicates massive efficiency gains from this approach.

  1. Night/Weekend Testing: Unlike humans, AI Agents don't need sleep. You can run 10,000 permutations overnight.
  2. Cost Reduction: The study projects a 0.5 man-month reduction per project cycle.
  3. Zero Maintenance: When the UI changes, you don't rewrite scripts. The AI adapts.

Security & Ethics Warning

While powerful, AI Agents executing web actions carry risks:

  • Data Leakage: Be careful sending proprietary specs or PII to public LLMs (OpenAI/Anthropic). Use Azure OpenAI or local models (Llama 3) for enterprise data.
  • Runaway Agents: Always implement a "Human-in-the-Loop" or a hard timeout to prevent the agent from clicking "Delete Database" if it gets confused.

Conclusion

The days of writing brittle XPath selectors are numbered. By combining Combinatorial Logic (to determine what to test) with AI Agents (to determine how to test), we can build a testing pipeline that heals itself.

**Your Next Step: \ Don't rewrite your Selenium suite yet. Start by picking one flaky test flow. Replace it with a browser-use agent and see if it survives the next UI update. \n

\

Market Opportunity
Sleepless AI Logo
Sleepless AI Price(AI)
$0.04061
$0.04061$0.04061
-0.34%
USD
Sleepless AI (AI) Live Price Chart
Disclaimer: The articles reposted on this site are sourced from public platforms and are provided for informational purposes only. They do not necessarily reflect the views of MEXC. All rights remain with the original authors. If you believe any content infringes on third-party rights, please contact [email protected] for removal. MEXC makes no guarantees regarding the accuracy, completeness, or timeliness of the content and is not responsible for any actions taken based on the information provided. The content does not constitute financial, legal, or other professional advice, nor should it be considered a recommendation or endorsement by MEXC.

You May Also Like

Zedcex Exposed as Major Crypto Platform Supporting IRGC Fund Transfers

Zedcex Exposed as Major Crypto Platform Supporting IRGC Fund Transfers

The core Iranian security force is comprised of the Iranian Islamic Revolutionary Guard Corps. Several Western administrations consider the Iranian Islamic Revolutionary
Share
Tronweekly2026/01/12 02:30
With $442M Raised, BlockDAG’s Presale Pushes Toward Jan 26 Finish! Polkadot & Dogecoin Remain Under Pressure

With $442M Raised, BlockDAG’s Presale Pushes Toward Jan 26 Finish! Polkadot & Dogecoin Remain Under Pressure

Explore how BlockDAG’s presale nears January 26 with a $0.003 special price, +1,566% upside, while Polkadot and Dogecoin remain under pressure.Read more...
Share
Coinstats2026/01/12 02:00
BetFury is at SBC Summit Lisbon 2025: Affiliate Growth in Focus

BetFury is at SBC Summit Lisbon 2025: Affiliate Growth in Focus

The post BetFury is at SBC Summit Lisbon 2025: Affiliate Growth in Focus appeared on BitcoinEthereumNews.com. Press Releases are sponsored content and not a part of Finbold’s editorial content. For a full disclaimer, please . Crypto assets/products can be highly risky. Never invest unless you’re prepared to lose all the money you invest. Curacao, Curacao, September 17th, 2025, Chainwire BetFury steps onto the stage of SBC Summit Lisbon 2025 — one of the key gatherings in the iGaming calendar. From 16 to 18 September, the platform showcases its brand strength, deepens affiliate connections, and outlines its plans for global expansion. BetFury continues to play a role in the evolving crypto and iGaming partnership landscape. BetFury’s Participation at SBC Summit The SBC Summit gathers over 25,000 delegates, including 6,000+ affiliates — the largest concentration of affiliate professionals in iGaming. For BetFury, this isn’t just visibility, it’s a strategic chance to present its Affiliate Program to the right audience. Face-to-face meetings, dedicated networking zones, and affiliate-focused sessions make Lisbon the ideal ground to build new partnerships and strengthen existing ones. BetFury Meets Affiliate Leaders at its Massive Stand BetFury arrives at the summit with a massive stand placed right in the center of the Affiliate zone. Designed as a true meeting hub, the stand combines large LED screens, a sleek interior, and the best coffee at the event — but its core mission goes far beyond style. Here, BetFury’s team welcomes partners and affiliates to discuss tailored collaborations, explore growth opportunities across multiple GEOs, and expand its global Affiliate Program. To make the experience even more engaging, the stand also hosts: Affiliate Lottery — a branded drum filled with exclusive offers and personalized deals for affiliates. Merch Kits — premium giveaways to boost brand recognition and leave visitors with a lasting conference memory. Besides, at SBC Summit Lisbon, attendees have a chance to meet the BetFury team along…
Share
BitcoinEthereumNews2025/09/18 01:20