Skip to main content

SAP QA Agent — UI automation engine + MCP Server packaging for SAP GUI

Project description

SAP QA Agent

PyPI version Python 3.12+

基于 AI 驱动的 SAP GUI 自动化测试引擎,支持测试用例解析、智能执行、AI 自愈和操作录制。

快速开始

# 安装
pip install sap-qa-agent

# 启动 MCP Server(配合 Claude Desktop / Kiro / Cursor 使用)
uvx --from sap-qa-agent sap-qa-mcp

核心功能

  • 测试用例解析 — 支持 Excel (.xlsx) 和 Markdown 格式
  • SAP GUI 自动化 — 基于 COM Scripting API 驱动 SAP 操作
  • AI 自愈 — 执行失败时自动分析并修复(基于智谱 GLM)
  • 知识库复用 — 积累脚本模板,加速后续执行
  • 操作录制 — 记录手动操作转化为可复用步骤

作为 MCP Server 被使用

SAP QA Agent 可作为 MCP (Model Context Protocol) Server,被 Claude Desktop、Kiro、Cursor 等 AI Agent 直接调用。

pip install sap-qa-agent
uvx --from sap-qa-agent sap-qa-mcp

详细接入指南请参阅 docs/mcp-integration.md,包含:

  • Claude Desktop / Kiro / Cursor 三种宿主的配置示例
  • SAP Scripting 启用步骤
  • GLM API Key 配置方式
  • 端到端使用示例
  • 可用工具列表与故障排查

项目结构

ui_test_python/
├── app/                    # 应用代码
│   ├── main.py             # FastAPI 入口
│   ├── mcp_server/         # MCP Server 实现
│   ├── core/               # 核心引擎(解析、执行、自愈)
│   ├── sap/                # SAP GUI 封装
│   ├── ai/                 # GLM AI 客户端
│   └── data/               # 数据模型与知识库
├── mcp_skills/             # MCP Skills 包
├── knowledge_base/         # 脚本模板知识库
├── tests/                  # 测试套件
├── examples/mcp/           # MCP 配置示例
├── docs/                   # 文档
│   └── mcp-integration.md  # MCP 接入指南
└── pyproject.toml          # 项目配置

可用的 MCP Skills

SAP QA Agent 提供 5 个预置 Skills:

Skill ID 功能
sap-parse-and-execute 解析并执行 SAP 测试用例
sap-session-bootstrap SAP 会话连接引导
sap-self-healing-playbook AI 自愈故障排查手册
sap-knowledge-base-reuse 复用知识库模板执行测试
sap-recording-to-testcase 将录制操作转换为测试用例

可用的 MCP Tools

  • parse_test_case - 解析测试用例文件
  • sap_connect - 连接 SAP GUI
  • sap_disconnect - 断开 SAP GUI 连接
  • sap_session_status - 检查 SAP 会话状态
  • execute_test_case - 执行测试用例
  • get_task_status - 获取任务状态
  • list_tasks - 列出任务
  • stop_task - 停止任务
  • capture_screen - 截取屏幕
  • list_skills - 列出 Skills
  • get_skill - 获取 Skill 详情
  • list_templates - 列出模板
  • get_template - 获取模板详情
  • start_recording - 开始录制
  • stop_recording - 停止录制
  • atomic.* - 原子化操作工具

环境要求

  • Python 3.12+
  • Windows 10/11
  • SAP GUI(已启用 Scripting)

使用方式

通过 PyPI 安装

pip install sap-qa-agent

通过 uvx 直接运行(无需安装)

uvx --from sap-qa-agent sap-qa-mcp

本地开发安装

pip install -e .

许可证

Private

版本历史

  • 0.2.0 (2026-05-09) - 移除 sap-qa-backend,只保留 MCP Server
  • 0.1.1 (2026-05-09) - 修复描述为 "for SAP GUI"
  • 0.1.0 (2026-05-09) - 初始版本发布到 PyPI

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sap_qa_agent-0.2.1-py3-none-any.whl (269.5 kB view details)

Uploaded Python 3

File details

Details for the file sap_qa_agent-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: sap_qa_agent-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 269.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for sap_qa_agent-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9a8cf764cb82e3ccf7f428f9a223431305db67a3bcad9328d99f41ce72591cb2
MD5 aabb20a0a1bd1e335219f6d81d04971f
BLAKE2b-256 25ced2e125435d7475adf71329b4bbde55779a9c5bbd22c3f1de6191fa1f8230

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page