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

2026/01/07 12:14
5 min read
For feedback or concerns regarding this content, please contact us at crypto.news@mexc.com

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(SLEEPLESSAI)
$0.01924
$0.01924$0.01924
+1.53%
USD
Sleepless AI (SLEEPLESSAI) 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 crypto.news@mexc.com 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

XRP Signals Imminent Breakout — Is A 10% Rally Coming?

XRP Signals Imminent Breakout — Is A 10% Rally Coming?

The post XRP Signals Imminent Breakout — Is A 10% Rally Coming? appeared on BitcoinEthereumNews.com. Buyers have been quietly stepping in at lower prices every
Share
BitcoinEthereumNews2026/04/26 07:01
Trump urges journalist to leave Pakistan as Iran peace talks stall

Trump urges journalist to leave Pakistan as Iran peace talks stall

The post Trump urges journalist to leave Pakistan as Iran peace talks stall appeared on BitcoinEthereumNews.com. Trump’s call for a Washington Post journalist to
Share
BitcoinEthereumNews2026/04/26 06:50
Live Nation CEO says demand is unmistakable, concert tickets are underpriced

Live Nation CEO says demand is unmistakable, concert tickets are underpriced

The post Live Nation CEO says demand is unmistakable, concert tickets are underpriced appeared on BitcoinEthereumNews.com. Live Nation CEO Michael Rapino and Smith Entertainment Group CEO Ryan Smith said this week live events are more central than ever to culture and commerce in a post-pandemic world. The executives spoke at CNBC Sport and Boardroom’s Game Plan conference on Tuesday, saying the demand for in-person events has been unmistakable. “No matter what you bring to that table that day, you unite around that one shared experience,” Rapino said. “For those two hours, I tend to drop whatever baggage I have and have a shared moment.” According to Goldman Sachs, the live music industry is expected to grow at a 7.2% compounded annual rate through 2030, fueled by millennials and Gen Z. Smith bought the Utah Jazz in 2020 and launched a new NHL franchise in the state in 2024. “In sports, we’re really media companies,” Smith said. “We’ve got talent, we’ve got distribution. We’re putting on a show or a wedding or something every night.” Get the CNBC Sport newsletter directly to your inbox The CNBC Sport newsletter with Alex Sherman brings you the biggest news and exclusive interviews from the worlds of sports business and media, delivered weekly to your inbox. Subscribe here to get access today. Rapino also emphasized how the economics of music have shifted. With streaming revenue dwarfed by touring income, live shows have become one of artists’ primary sources of revenue. “The artist is going to make 98% of their money from the show,” he said. “We just did Beyonce’s tour. She’s got 62 transport trucks outside. That’s a Super Bowl she’s putting on every night.” Despite headlines about rising ticket prices, Rapino argued that concerts are still underpriced compared to sporting events. “In sports, I joke it’s like a badge of honor to spend 70 grand for Knicks courtside,” Rapino said.…
Share
BitcoinEthereumNews2025/09/18 01:41

Roll the Dice & Win Up to 1 BTC

Roll the Dice & Win Up to 1 BTCRoll the Dice & Win Up to 1 BTC

Invite friends & share 500,000 USDT!