美文网首页
python—airtest

python—airtest

作者: 小二哥很二 | 来源:发表于2019-11-08 10:14 被阅读0次

一、webUI自动化

1、airtest简介

Airtest是网易出品的一款基于图像识别和poco控件识别的一款UI自动化测试工具。
官方网站:http://airtest.netease.com/
安装:官方网站下载文件为zip压缩包文件,直接解压,即可使用

2、启动

1)设置浏览器驱动和Log路径
做ui自动化,首先要设置浏览器:在选项-设置中**

image.png
默认Log选项也在此页面
2)启动浏览器
首先点击窗口-selenium window,打开辅助窗口,然后点击圆球图标启动浏览器
image.png
然后点击提示语中的“Yes”,生成了初始化代码
# -*- encoding=utf8 -*-
__author__ = "小二哥"

from airtest.core.api import *

auto_setup(__file__)
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from airtest_selenium.proxy import WebChrome
driver = WebChrome()
driver.implicitly_wait(20)

3、编写脚本,功能介绍

start_web:访问指定url
touch:定位并点击页面元素,执行click操作
text:定位并点击元素,执行sendkeys操作
assert:断言
snapshot:截屏
previous_tab&new_tab:浏览器标签页的切换
airtest_touch:当touch定位不到元素时候,可以用此功能,会在浏览器指定位置截屏并点击,和sikuli有点类似
assert_template:就是断言airtest_touch框选的图片是否存在
※iframe切换要用python语法:
driver.switch_to_frame(),里面只能是id或者name,或者索引
driver.switch_to_default_content()回到主界面


image.png
4、Record按钮,就是录制,点击之后,会录制在浏览器上的操作,并自动生成代码
image.png

相关文章

  • python—airtest

    一、webUI自动化 1、airtest简介 Airtest是网易出品的一款基于图像识别和poco控件识别的一款U...

  • airtest使用

    1、python安装airtest 1)pipinstallairtest时,提示找不到powershell, 解...

  • Airtest环境准备、软件安装和使用

    一、安装JDK、ADB(自行搜索安装)二、安装Python环境(建议安装Python3)三、安装Airtest,下...

  • AirTest—环境配置

    一、安装Python环境 安装Python3.6、配置环境变量 二、下载AirTest安装包 官网下载:http:...

  • AirtestIDE框架使用指南

    Airtest使用 准备工作 下载Airtest:http://airtest.netease.com/ 简单使用...

  • Airtest开发App爬虫

    使用Airtest超快速开发App爬虫 在Airtest中如何正确使用无线模式控制手机在使用Airtest超快速开...

  • Airtest简介

    Airtest是一个跨平台的UI自动化框架,适用于游戏、APP。 Airtest特性 跨平台: Airtest可以...

  • windows应用自动化测试学习笔记

    参考文档 Airtest Project Docs(入门介绍):https://airtest.doc.io.ne...

  • pytest+selenium+airtest(1)

    简介:pytest是python的一套测试框架,selenium是用于web的ui自动化工具,airtest是一套...

  • airtest使用问题集合

    1:pycharm运行airtest脚本提示No module named 'airtest.core',如下述脚...

网友评论

      本文标题:python—airtest

      本文链接:https://www.haomeiwen.com/subject/zzfibctx.html