[KongchangAI]
Deep Dives· 3 min read· 1,564 words

Factifai: A Deep Dive into the Visual AI-Powered Open-Source Tool for CI/CD Automated Testing

Factifai: A Deep Dive into the Visual AI-Powered Open-Source Tool for CI/CD Automated Testing

Factifai replaces DOM selectors with visual AI for natural language-driven automated testing

Factifai Agent Suite is an AI-driven automated testing tool open-sourced by Presidio. It leverages vision-capable LLMs like Claude and GPT-4o to "see" the screen and control the computer, replacing the fragile DOM selector-based locator strategies of traditional testing. It supports natural language test case descriptions, integrates seamlessly into CI/CD pipelines, offers stronger robustness against UI changes, and dramatically reduces test maintenance costs and authoring barriers—though it faces challenges around API costs and result stability.

Project Overview: Redefining Automated Testing with Visual AI

In the Continuous Integration and Continuous Deployment (CI/CD) pipeline of software development, automated testing has always been a critical component for ensuring delivery quality. However, traditional automated testing tools often rely on fragile locator strategies like DOM selectors and XPath. Whenever the frontend interface changes, test scripts can break on a massive scale.

The DOM (Document Object Model) is a tree structure generated by the browser after parsing an HTML document. Developers use CSS selectors or XPath expressions to locate specific elements on the page. For example, a login button might be located via #login-btn or //button[@class='submit']. The fundamental problem with this approach is its tight coupling to the page's specific implementation—when developers refactor components, switch UI frameworks (e.g., migrating from React to Vue), or even just adjust CSS class names, these locator expressions break. Industry statistics show that end-to-end test maintenance can account for 40%-60% of total testing investment in large projects, with most of that time spent fixing selector failures caused by UI changes.

Factifai Agent Suite proposes an entirely new approach—leveraging vision-capable large models (such as Claude and GPT-4o) to "see" the screen and control the computer, completing clicks, inputs, and result verification just like a real human.

This project, open-sourced by Presidio (GitHub repository), is built with TypeScript. Its goal is to seamlessly embed AI-driven computer control capabilities into existing CI/CD pipelines, fundamentally solving the pain points of high maintenance costs and fragile scripts in traditional end-to-end testing.

Core Philosophy: Letting AI Test Like a Human

Vision Models Replace Traditional DOM Selectors

Traditional end-to-end testing frameworks (such as Selenium, Cypress, and Playwright) require developers to write precise element locator code. While this approach is mature, it has obvious maintenance pain points: test scripts frequently break after UI refactoring, and writing and maintaining them is expensive.

Factifai takes a fundamentally different approach. It calls upon vision-capable large models like Claude or GPT-4o to analyze screenshots of the application interface. These models are Multimodal Large Language Models (Multimodal LLMs), where GPT-4o's "o" stands for "omni," meaning they can process both text and image inputs simultaneously. Their visual understanding goes far beyond simple OCR text recognition—they possess spatial layout comprehension, UI component semantic recognition, and contextual reasoning capabilities. For example, a model can understand that a blue rectangular area containing the text "Submit" is a clickable submit button, even if that button lacks any HTML semantic tags. This capability stems from pre-training on massive amounts of web page screenshots, application interfaces, and design mockups, giving the model rich knowledge of UI patterns.

The AI model understands the current page state by "looking" at the screen, then decides the next action—clicking a button, typing text in an input field, scrolling the page, or verifying whether an element is displayed correctly.

The greatest advantage of this approach is robustness: even if a button moves position, its text is slightly adjusted, or its style changes, as long as a human can recognize it, the AI can operate it correctly too. For frontend projects with frequent iterations, this means a dramatic reduction in test maintenance costs.

Natural Language-Driven Test Cases

Another significant benefit of vision model-based testing is that test cases can be described in natural language. For example, you can tell Factifai:

"Open the login page, enter the username and password, click the login button, and verify that it navigates to the dashboard page."

The AI Agent will autonomously plan and execute the steps without writing a single line of locator code. This dramatically lowers the barrier to automated testing, enabling QA engineers and even product managers to directly participate in writing test cases—truly achieving "testing for everyone."

Technical Architecture and Implementation Details

Layered Design of the Agent Suite

Factifai is defined as an Agent Suite, meaning it's not a single tool but a set of collaborating AI Agents. Based on the project structure and description, its architecture contains the following core components:

  • Visual Perception Layer: Responsible for capturing application interface screenshots and sending them to vision models for analysis
  • Decision Planning Layer: Plans the next sequence of actions based on the model's understanding results
  • Execution Control Layer: Translates AI decisions into actual computer operations like mouse clicks and keyboard inputs
  • Verification Feedback Layer: Takes another screenshot after executing actions to verify whether the results match expectations

This layered architecture follows the mainstream paradigm of current AI Agent design—an engineering implementation of the ReAct (Reasoning + Acting) pattern. In this architecture, "thinking" and "acting" are explicitly separated: the decision planning layer is responsible for decomposing high-level goals into executable step sequences (similar to human task planning), while the execution control layer converts abstract instructions into concrete system calls. This separation brings important engineering advantages: the planning layer can switch between different vision models (e.g., from Claude to GPT-4o) without modifying the execution layer's code. Meanwhile, the closed-loop mechanism formed by the verification feedback layer gives the Agent self-correction capabilities—if a click doesn't produce the expected effect, the Agent can re-analyze the screen state and adjust its strategy.

This layered architecture allows each component to evolve independently and facilitates support for different vision model backends.

Integration with CI/CD Pipelines

The project explicitly emphasizes its CI/CD pipeline integration capabilities. In modern CI/CD practice, testing is typically divided into multiple stages: unit tests (millisecond-level, verifying function logic), integration tests (second-level, verifying module interactions), and end-to-end tests (minute-level, verifying complete user flows). End-to-end tests sit at the top of the testing pyramid—fewest in number but broadest in coverage, and also the most expensive to maintain. In traditional approaches, teams typically use frameworks like Selenium WebDriver, Cypress, or Playwright to run tests in headless browser environments.

Factifai's innovation is that it can replace or supplement this testing layer, particularly suited for scenarios where the UI changes frequently but core business flows remain stable. It can run as a step in the pipeline, automatically executing visual tests after each code commit or deployment and outputting structured test reports. For teams using GitHub Actions, GitLab CI, or Jenkins, Factifai can run as an independent Job, blocking the deployment pipeline on test failure and generating visual reports with screenshots. This integration approach can quickly fit into existing workflows without significant adjustments to the deployment process.

The Rise of Computer Use Capabilities

Factifai's emergence is not an isolated case. Since Anthropic first released Claude's Computer Use capability in October 2024, "AI controlling computers" has become a hot topic. This technology marks a critical leap for AI from "conversational assistant" to "digital workforce." The technical principle is: the AI model receives screenshots as input and outputs structured operation commands (such as coordinate clicks, keyboard inputs, scrolling, etc.), which are converted into actual system-level operations by a local agent program. The entire process forms a closed loop of "screenshot → analysis → action → screenshot." Unlike traditional RPA (Robotic Process Automation) tools that rely on fixed rules, the Computer Use approach possesses understanding and reasoning capabilities, able to handle unforeseen interface states and exceptions.

Products like OpenAI's Operator and Google's Project Mariner are also exploring similar paths. Factifai focuses this capability on the specific domain of software testing, finding a highly pragmatic landing point.

The Cost vs. Reliability Tradeoff

Of course, this approach also faces real-world challenges:

  • API call costs: Each test step requires calling a vision model API, making costs significantly higher than traditional testing frameworks. Based on current pricing estimates, Claude 3.5 Sonnet processing one screenshot (approximately 1000 tokens of image input) plus text prompts and responses costs about $0.01-0.03 per call. A typical end-to-end test scenario (such as completing a shopping flow) might require 15-30 screenshot analyses and decisions, bringing the cost per test run to approximately $0.30-0.90. If you run 50 test scenarios daily in CI, monthly costs could reach $450-1,350. By comparison, traditional Selenium test running costs are nearly zero (requiring only compute resources). However, this cost needs to be weighed against the human maintenance time saved—the time cost a QA engineer spends each month fixing broken test scripts may far exceed this figure. As model inference costs drop at approximately 50% per year, the economics will increasingly favor the AI approach.
  • Result stability: LLM outputs have inherent uncertainty; ensuring test result reproducibility is an engineering challenge that requires continuous optimization
  • Execution speed: Model inference latency means individual test runs may take longer than traditional scripts

The project is still in its early stages (18 Stars, 8 Forks), but the direction it represents is worth continued attention. As vision model capabilities continue to improve and inference costs decline, AI-driven automated testing is poised to gradually move from experimental to mainstream.

Conclusion

Factifai Agent Suite represents a paradigm shift in automated testing: from "writing scripts that tell machines how to do things" to "using natural language to tell AI what to verify." While still in its early exploration phase, the possibilities it demonstrates—lower maintenance costs, stronger robustness, and a lower barrier to entry—are enough to warrant attention from every developer focused on test engineering and DevOps practices.

If your team is struggling with test scripts constantly breaking due to frequent UI changes, or if you want to explore practical applications of AI Agents in CI/CD, Factifai is an open-source project worth trying.

#Factifai#visual AI testing#CI/CD automated testing#computer use AI#natural language testing#end-to-end testing#AI agent testing
Share:

Related articles