This document provides a comprehensive introduction to HttpRunner v5, an all-in-one testing framework that combines API testing, load testing, and AI-driven UI automation capabilities. This overview covers the framework's core architecture, key components, and technological approach implemented in the Go codebase. For detailed information about specific testing capabilities, see Features and Capabilities. For migration guidance from earlier versions, see Version History and Migration.
HttpRunner (commonly referred to as hrp) is an open-source testing framework that began in 2017 as an API testing tool and has evolved into a comprehensive automation platform. Version 5 represents a complete rewrite in Go with innovative AI-driven UI automation capabilities powered by large language models.
⚠️ Note: HttpRunner v5 only includes the Golang version, and the Python version of the code has been migrated to httprunner/httprunner.py
The framework provides a unified approach across multiple testing domains through a single binary that handles:
HRPRunner and SessionRunnerboomer integrationXTDriver with AI planning through ILLMServicefunplugin supporting Go/Python custom functionsHttpRunner eliminates tool fragmentation by providing a cohesive testing ecosystem centered around the hrp CLI, implemented in cmd/hrp/main.go1-100
Sources: README.md9-13 README.en.md9-13 docs/CHANGELOG.md143-150
HttpRunner v5 architecture is built on several key technical principles implemented through specific Go components:
Pure Visual-Driven UI Automation: Unlike traditional frameworks using element locators, HttpRunner employs computer vision through OCR services and visual language models. The XTDriver orchestrates interactions while ILLMService implementations (Planner, Asserter, Querier) provide AI-driven understanding of user interfaces.
Golang Technology Stack: The framework leverages Go's concurrency model through goroutines for load testing via boomer integration, single binary deployment, and cross-platform compilation targeting multiple architectures.
AI Integration: LLM integration through Wings service and ILLMService interface enables intelligent test planning, assertion generation, and natural language instruction parsing via the AIAction API in StepMobile.
Unified API Design: The IStep interface provides consistent execution semantics across StepRequest (API), StepMobile (UI), and load testing scenarios. The TCase structure unifies test case representation across formats.
Cross-Platform Driver Abstraction: The IDriver interface abstracts platform differences, with concrete implementations: WDADriver (iOS), ADBDriver/UIA2Driver (Android), HDCDriver (HarmonyOS), and BrowserDriver (web).
Sources: README.md15-21 README.en.md15-21 docs/CHANGELOG.md147-150
The hrp CLI serves as the primary interface implemented in cmd/hrp/main.go1-100 with subcommands defined across multiple command files:
The CLI architecture maps user commands to specific Go implementations:
| Command | Implementation File | Core Function | Purpose |
|---|---|---|---|
run | cmd/run.go | HRPRunner.Run() | Execute API tests via Go engine |
boom | cmd/boom.go | BoomerRunner.Run() | Distributed load testing |
mcp-server | cmd/mcp_server.go | MCPServer4XTDriver | UI automation MCP server |
server | cmd/server.go | HTTP handler registration | REST API for UI automation |
convert | cmd/convert.go | Format converters | Transform test case formats |
pytest | cmd/pytest.go | Python subprocess | Python engine integration |
Sources: README.md66-92 README.en.md63-89
The framework consists of several interconnected subsystems implemented across the Go module structure:
| Layer | Go Package | Key Structs | Responsibility |
|---|---|---|---|
| CLI | cmd/ | cobra.Command | User interface and command routing |
| Core Engine | hrp/ | HRPRunner, CaseRunner, SessionRunner | Test orchestration and execution |
| Load Testing | hrp/ | BoomerRunner, Master, Worker | Distributed performance testing |
| UI Automation | uixt/ | XTDriver, StepMobile, MCPServer | AI-driven UI interaction |
| AI Services | uixt/ | ILLMService, Wings, Planner | LLM integration and planning |
| Drivers | uixt/ | IDriver, WDADriver, ADBDriver | Platform-specific device control |
| Plugin System | funplugin/ | Plugin, PythonPlugin, GoPlugin | Custom function extension |
Sources: Based on system diagrams provided and docs/CHANGELOG.md143-150
HttpRunner's most significant innovation is its AI-powered UI automation system implemented in the uixt package, representing a paradigm shift from element-based to vision-based intelligent testing.
| Natural Language Concept | Go Implementation | File Location |
|---|---|---|
| "AI Action" | AIAction(instruction string) method | uixt/stepmobile.go |
| "Vision Understanding" | Planner.Plan() with screenshot | uixt/planner.go |
| "Tool Registry" | MCPServer4XTDriver.tools map | uixt/mcp_server.go |
| "Device Control" | IDriver interface methods | uixt/driver.go |
| "LLM Integration" | Wings struct + API client | uixt/wings.go |
| "Cross-Platform Support" | Multiple IDriver implementations | uixt/*_driver.go |
The AI system enables semantic UI understanding through LLM integration while maintaining platform compatibility via the IDriver abstraction layer.
Sources: docs/CHANGELOG.md143-150 docs/CHANGELOG.md38-53
HttpRunner has undergone significant architectural evolution since its inception in 2017, with v5 representing a complete platform transformation:
| Version | Primary Language | Key Modules/Packages | Execution Model |
|---|---|---|---|
| v1-v3 | Python | httprunner pip package | Python subprocess via pytest |
| v4 | Go + Python | hrp/ + uixt/ + Python fallback | HRPRunner + BoomerRunner structs |
| v5 | Go only | hrp/ + uixt/ + funplugin/ | Native Go execution with AI services |
v3.0 (2020): Python ecosystem consolidation
TCase and TStep models in Pythonv4.0 (2022): Go implementation introduction
HRPRunner struct in hrp/runner.goIDriver interface in uixt/driver.goboomer integration for load testingv4.3 (2022): UIXT package release
XTDriver and device-specific driversv5.0 (2023+): AI-driven testing platform
ILLMService interface and Wings implementationMCPServer4XTDriverAIAction() API| Component | v3 Python | v4 Go | v5 Enhanced |
|---|---|---|---|
| Test Runner | httprunner.run() | HRPRunner.Run() | HRPRunner.Run() + AI |
| Test Case | Python dict | TCase struct | TCase + StepMobile |
| Load Testing | locust integration | BoomerRunner | BoomerRunner + distributed |
| UI Testing | N/A | XTDriver basic | XTDriver + AI planning |
| Plugin System | Python only | funplugin Go/Python | Enhanced funplugin |
Sources: docs/CHANGELOG.md143-150 docs/CHANGELOG.md304-481 README.md9-13
HttpRunner is designed for seamless integration into existing development workflows:
The framework's deployment model prioritizes simplicity while providing enterprise-grade scalability and extensibility.
Sources: README.md48-55 README.en.md48-55 go.mod3-5
Refresh this wiki