Windows Application Driver

Windows应用程序驱动程序是一种在Windows应用程序上支持类似Selenium的UI测试自动化的服务。(Windows Application Driver is a service to support Selenium-like UI Test Automation on Windows Applications.)

Github stars Tracking Chart

Windows应用程序驱动程序

Windows 应用程序驱动程序是一项服务,用于在 Windows 应用程序上支持类似于 Selenium 的 UI 测试自动化。此服务支持在 Windows 10 个人电脑上测试 通用 Windows 平台(UWP)Windows Forms (WinForms)、Windows Presentation Foundation (WPF)传统 Windows(Win32)应用程序。

安装和运行 WinAppDriver

  1. https://github.com/Microsoft/WinAppDriver/releases 下载 Windows Application Driver 安装程序;
  2. 在安装了测试应用程序的 Windows 10 计算机上运行安装程序,并进行测试;
  3. 在 Windows settings 中打开 Developer Mode
  4. 从安装目录(例如 C:\Program Files(x86)\Windows Application Driver)运行 WinAppDriver.exe

然后,Windows Application Driver 将在测试机器上运行,侦听默认IP地址和端口( 127.0.0.1:4723 )上的请求。然后,您可以运行我们的任何 测试示例。WinAppDriver.exe 可以配置为侦听不同的 IP 地址和端口,如下所示:

WinAppDriver.exe 4727
WinAppDriver.exe 10.0.0.10 4725
WinAppDriver.exe 10.0.0.10 4723/wd/hub
注意:您必须以管理员身份运行 WinAppDriver.exe 以侦听其他IP地址和端口。

编写一个自动化脚本

您可以选择 Appium/Selenium 支持的任何编程语言或工具编写测试脚本。在下面的例子中,我们将使用 Microsoft Visual Studio 在 C# 中编写测试脚本。

现在您已经成功安装了 WinAppDriver,您可以开始编写您的第一个自动化脚本了

支持的 API

查看这里,WinAppDriver 支持的 API 列表。API 的支持可能与 Appium 和其他同类产品不同。

常见问题和文档

关于 WinAppDriver 和相关主题的其他文档可以在 Docs/ 下找到,例如以下内容。

储存库内容

本资源库包括以下内容。

  • Samples -- 用于展示各种命令和操作,如打开应用程序、查找元素、点击元素、键入按键、阅读文本等;可针对内置的 Windows 10 应用程序运行,如 Alarms & Clock、Calculator 和 Notepad。
  • Tests -- 用于验证 Windows 应用程序驱动程序本身的功能。这些测试广泛地覆盖了每个 API 端点,并针对所有基本的UI控制场景,并演示了如何在 C# 中调用某些命令。此外,它们还演示了如何与一些更复杂的 UI 元素进行交互,如DatePicker, SplitViewPane, Slider等。
  • UI Recorder -- 独立的工具,旨在为用户提供一个更简单的方式来创建自动脚本,通过记录用户执行的 UI 事件,并在飞行中生成 XPath 查询和 C# 代码。在我们的 Wiki 上阅读更多关于它的信息。
  • Docs -- 子目录,存放 WinAppDriver 相关文档。

对新功能进行投票

在问题中添加您的功能请求或+1 (+1)现有的问题,标签为 "增强"。

(The first version translated by vz on 2020.09.09)

Overview

Name With Ownermicrosoft/WinAppDriver
Primary LanguageC#
Program languageC# (Language Count: 3)
PlatformWindows
License:MIT License
Release Count21
Last Release Namev1.2.99 (Posted on )
First Release Namev0.1-beta (Posted on )
Created At2016-03-20 08:48:45
Pushed At2024-04-14 05:58:05
Last Commit At2022-07-29 16:41:20
Stargazers Count3.5k
Watchers Count237
Fork Count1.4k
Commits Count308
Has Issues Enabled
Issues Count1881
Issue Open Count1050
Pull Requests Count34
Pull Requests Open Count44
Pull Requests Close Count29
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private

Windows Application Driver

Windows Application Driver (WinAppDriver) is a service to support Selenium-like UI Test Automation on Windows Applications. This service supports testing Universal Windows Platform (UWP), Windows Forms (WinForms), Windows Presentation Foundation (WPF), and Classic Windows (Win32) apps on Windows 10 PCs.

Install & Run WinAppDriver

  1. Download Windows Application Driver installer from https://github.com/Microsoft/WinAppDriver/releases
  2. Run the installer on a Windows 10 machine where your application under test is installed and will be tested
  3. Enable Developer Mode in Windows settings
  4. Run WinAppDriver.exe from the installation directory (E.g. C:\Program Files (x86)\Windows Application Driver)

Windows Application Driver will then be running on the test machine listening to requests on the default IP address and port (127.0.0.1:4723). You can then run any of our Tests or Samples. WinAppDriver.exe can be configured to listen to a different IP address and port as follows:

WinAppDriver.exe 4727
WinAppDriver.exe 10.0.0.10 4725
WinAppDriver.exe 10.0.0.10 4723/wd/hub

Note: You must run WinAppDriver.exe as administrator to listen to a different IP address and port.

Write an Automation Script

Now that you've successfully installed WinAppDriver, you can get started with authoring your first automation script!

Supported APIs

See here for a list of supported APIs by WinAppDriver. API support may differ from Appium and other counterparts.

FAQ & Documentation

Additional documentation on WinAppDriver and related topics can be found under /Docs/, such as the following:

Repository Content

This repository includes the following content:

  • Samples - used to showcase various commands and operations such as opening applications, finding elements, clicking elements, typing keystrokes, reading texts, etc; and can be run against built-in Windows 10 applications such as Alarms & Clock, Calculator, and Notepad.
  • Tests - used to verify the functionality of Windows Application Driver itself. The tests cover each API endpoints extensively and also against all basic UI control scenario, and demonstrate how to invoke certain command in C#. In addition, they show how to interact with some more complex UI elements such as DatePicker, SplitViewPane, Slider, etc.
  • UI Recorder - standalone tool that aims to provide users a simpler way of creating automaton scripts by recording UI events performed by the user and generating XPath queries and C# code on the fly. Read more about it on our Wiki.
  • Docs - subdirectory hosting WinAppDriver related documentation.

Vote on New Features

Add your feature request in issues or :+1: (+1) existing issues labeled as Enhancement

To the top