栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

WinAppDriver使用

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

WinAppDriver使用

一、WinAppDriver简介:

       参见:https://github.com/microsoft/WinAppDriver

       Windows Application Driver(WinAppDriver)是在windows应用程序上支持类似Selenium的UI自动化测试服务。支持这些类型的测试Universal Windows Platform (UWP), Windows Forms (WinForms), Windows Presentation Foundation (WPF), and Classic Windows (Win32) apps on Windows 10 PCs。

       以上是从GitHub官网翻译过来的,对我的需求讲是可以在Windows 10PC电脑上进行客户端的自动化测试。

二、环境搭建:

      (一)  WinAppDriver环境搭建

  1.   安装WinAppDriver:

            1)      下载地址:https://github.com/microsoft/WinAppDriver/releases

                     选择最新的release版本就行,比如我用的是v1.1.1 Release

            2)      直接运行WindowsApplicationDriver.msi进行安装。

                    这里一定要注意,必须要通过安装文件进行安装,不要复制安装之后的文件夹,在一台新的没有安装过WindowsApplicationDriver.msi的电脑,只是将其他电脑的安装目录的文件夹及所有文件复制过来,运行的过程会有无法找到控件的情况发生。

      2.开启开发者模式:

            1)      在Windows的开始菜单找到“设置”

                    

               2)      搜索“开发者选项设置“

                   

              3)      打开“开发人员模式”选项

                   

           4)      启动:

                  使用的时候,在命令行运行WinAppDriver.exe就行,根据实际情况可以选择以下几种方式:

1 WinAppDriver.exe 4727
2 WinAppDriver.exe 10.0.0.10 4725
3 WinAppDriver.exe 10.0.0.10 4723/wd/hub

      (二)  WinAppDriverUiRecorder使用:

             1.下载:https://github.com/Microsoft/WinAppDriver/releases

             2.使用方法参见:https://github.com/Microsoft/WinAppDriver/wiki/WinAppDriver-UI-Recorder

      (三)  开发环境搭建

           1、 Java环境搭建

                1)      下载:Java Downloads | Oracle

                2)      配置环境变量

           2、 安装配置maven

               1)      下载:http://mirrors.hust.edu.cn/apache/maven/maven-3/3.2.5/binaries/apache-maven-3.2.5-bin.tar.gz

               2)      配置环境变量

三、框架demo,参见:https://github.com/nanshufang/WinAppDriverDemo

到此基本完成~

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/269552.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号