perfecto使用
总配置
application.properties
env.resources=src/main/resources/common #配置resource文件所在目录,如.loc定位文件
resources.load.subdirs=2 #配置加载子目录层次
scenario.file.loc=src/main/resources/scenarios #配置场景.feature文件目录
step.provider.pkg=com.quantum.steps #配置自定义关键字包
driver.name=chromeDriver #配置driver的名称
webdriver.chrome.driver=D:/xx/xx/chromedriver.exe #配置diver位置
driver.pluginType=intellij #指定IDE
driver.init.retry.timeout=60 #指定timeout
selenium.wait.timeout=15000 #指定wait.timeout
selenium.success.screenshots=0 #指定成功是否截图
wd.command.listeners=com.quantum.listeners.PerfectoDriverListener #指定监听器
teststep.listeners=com.quantum.listeners.QuantumReportiumListener #指定监听器
##When enabled your test will be retried from the start
##customizations can be made to your own personal retry analyzer - please see the documentation on our github wiki page
##https://github.com/Project-Quantum/Quantum-Starter-Kit/wiki
#retry.count=1
#retry.analyzer=com.quantum.utils.Retry
##user proxy for API calls - enable this and set you proxy details
##if you encounter unexpected errors when downloading perfecto reports
#proxyHost=127.0.0.1
#proxyPort=8888
#proxyUser=1
#proxyPassword=1
##enable to turn on parallel data providers
##you must also define in testNg.xml the data provider thread count
##<suite name=....... data-provider-thread-count="10">
#global.datadriven.parallel=true
##set true to fill bean randomly from set of test-data
#bean.populate.random=false
##set 1 to suppress success log, when 0 it will also show verification success message
report.log.skip.success=0
##Use this key to add test data in the scenario names for Reportium results
#addFullDataToReport=true
##Use this key to pass the skipped tests, by default all the skipped tests will be marked as fail in reportium
#skippedTests=pass
#perfecto.capabilities.user=yourname@xxx.com
##generate the security token using this document - https://developers.perfectomobile.com/display/PD/Security+Token
#perfecto.capabilities.securityToken=<<XX_XX_SECURITY_TOKEN>>
#perfecto.capabilities.password=yourpassword
#perfecto.capabilities.automationName=Appium
#perfecto.capabilities.browserName=MobileOS
##switch download reports true/false to download reports.
#perfecto.download.reports=false
#perfecto.download.summaryReports=false
#perfecto.download.video=false
#perfecto.download.attachments=false
#perfecto.report.location= perfectoReports
#perfecto.offlineToken= <<CQ_LAB_SECURITY_TOKEN>>
在指定的步骤包中自定义步骤(关键字)
@Then("I switch to \"(.*?)\" frame by element")
public static void switchToFrameByElement(String loc) {
new WebDriverTestBase().getDriver().switchTo().frame(new QAFExtendedWebElement(loc));
}
在指定的resource文件夹中编写.loc元素定位文件
#input.box = xpath=//input[@id='kw']
input.box = id=kw
#search.button=["xpath=//input[@id='su']","xpath=//button[@aria-label='Baidu Search']"]
search.button = ["xpath=//input[@id='su']"]
在指定的场景目录中编写.feature文件
@BaiduSearch
Feature: Baidu Search
Scenario: Search CSDN
Given I open browser to webpage "https://www.baidu.com/"
Then I enter "CSDN" to "input.box"
Then I click on "search.button"
Then I wait for "5" seconds
配置TestNG的xml文件
在TestNG的xml文件中调用@BaiduSearch注解,同时可修改application.properties中的属性,如.loc的目录
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Baidu Search Demo Suite" verbose="0" parallel="tests"
thread-count="100">
<listeners>
<listener class-name="com.quantum.listeners.QuantumReportiumListener"/>
</listeners>
<test name="Web Scenarios Test" enabled="true" thread-count="10">
<parameter name="env.resources" value="src/main/resources/baidu"/>
<groups>
<run>
<include name="@BaiduSearch"/>
</run>
</groups>
<classes>
<class name="com.qmetry.qaf.automation.step.client.gherkin.GherkinScenarioFactory"/>
</classes>
</test>
</suite>
Refer
https://blog.csdn.net/Cupupup/article/details/80154544
perfecto使用的更多相关文章
- 自动化框架Quantum Automation Framework+cucumber+perfecto
名词解释 Quantum: 一款基于JAVA的自动化框架,支持手机和桌面WEB的自动化测试.与cucumber和perfecto实现了整合,用于BDD自动化. Refer: http://projec ...
- 手机APP测试——Perfecto
基于 Perfecto mobile cloud 的移动端自动化测试实践 本文将介绍 Pefecto mobile cloud 在移动端自动化测试的应用. Pefecto 将真实移动设备放到 clou ...
- 对Android开发者有益的40条优化建议
下面是开始Android编程的好方法: 找一些与你想做事情类似的代码 调整它,尝试让它做你像做的事情 经历问题 使用StackOverflow解决问题 对每个你像添加的特征重复上述过程.这种方法能够激 ...
- 安卓开发经验分享:资源、UI、函数库、测试、构建一个都不能少(转)
除了高超的武艺,每位黑忍者还需要装备最好的武器.在软件开发的世界里,好的工具能让我们的生活变得更轻松,在更短的时间里写出更棒的代码. 时光回到2008年,那时安卓还很年轻.只有几个相关的博客和谷歌官方 ...
- 对 Android 开发者有益的 40 条优化建议
本文转载于:http://www.oschina.net/translate/40-developer-tips-for-android-optimization?cmp 下面是开始Android编程 ...
- 【转】对Android开发者有益的40条优化建议
下面是开始Android编程的好方法: 找一些与你想做事情类似的代码 调整它,尝试让它做你像做的事情 经历问题 使用StackOverflow解决问题 对每个你像添加的特征重复上述过程.这种方法能够激 ...
- [转]对Android开发者有益的40条优化建议
下面是开始Android编程的好方法: 找一些与你想做事情类似的代码 调整它,尝试让它做你像做的事情 经历问题 使用StackOverflow解决问题 对每个你像添加的特征重复上述过程.这种方法能够激 ...
- 【Mood-12】Android开发相关书籍推荐
新年伊始,找到Android进阶干货若干,2015拜读. 1.Android应用UI设计模式 目前,谷歌Android操作系统在移动市场中风头正劲,并且未来发展势不可挡.<Android应用UI ...
- iOS 应用测试最佳实践
IOS改变了移动游戏,毫无疑问.它为“移动时代”铺平了道路,通过简单的用户体验提供惊人的功能.然而涉及到测试与监控,使用iPhone/iPad移动应用程序是除了简单之外的任何事情. 随着IOS应用市场 ...
随机推荐
- 阿里云服务器配置https
第一步 在阿里云控制台找到申请ssl证书的地址(我申请的是阿里云免费的证书,申请完要等申请通过,可能要等待一两天) 第二步下载ssl nginx版本的证书 第三步上传证书(包含.key, .pem这两 ...
- sqlalchemy.exc.InternalError: (pymysql.err.InternalError) (1366, "Incorrect string value: '\\xE6\\xB1\\x89\\xE8\\xAF\\xAD...' for column 'className' at row 1") [SQL: INSERT INTO classmessage (`classId
sqlalchemy.exc.InternalError: (pymysql.err.InternalError) (1366, "Incorrect string value: '\\xE ...
- 第四篇 HTML 表单深入了解、注释和a标签的运用
表单深入了解.注释和a标签的运用 注释,HTML中的注释格式: 开头 <!-- 结束 --> 例子: <!-- <div>我被注释了</div> - ...
- Python(os和sys)理解
Python(os和sys)理解 os模块负责程序与操作系统的交互,提供了访问操作系统底层的接口; sys模块负责程序与python解释器的交互,提供了一系列的函数和变量,用于操控python的运行时 ...
- TableView 键盘弹起冲突
1.TableView 上cell 带有 TextField,如果 是Plain 形式的TableView ,并且设置SectionHeader的 取消粘滞效果 会导致键盘弹起,页面不能正常 上移 问 ...
- cmd窗口颜色设置
color 02 第一个数字是背景颜色,第二个是文字颜色.
- 修改phpMyAdmin 导入MySQL数据库文件大小限制
默认情况下,phpMyAdmin导入MySQL数据库文件大小为2M. 很多朋友对网站进行搬家的时候,网站数据进行导入时会出现一些问题,提示超出导入大小限制. 默认MYSQL只能导入最大2MB的数据,于 ...
- zencart网站上线前,邮件模板默认网址修改
涉及到的文件 includes\languages\语言包\模板\email_extras.php 后台\includes\languages\语言包\email_extras.php 后台\incl ...
- jdbc 占位符插入null值 NullPointerException
如果变量flag 为空 ,那么executeUpdate 后面的参数 bookCollect.getFlag() 就会被executeUpdate()方法忽略掉,程序会报错. String addSq ...
- 有关 CMMI
CMMI的全称为Capability Maturity Model Integration,即能力成熟度模型集成.CMMI是CMM模型的最新版本.早期的CMMI(CMMI-SE/SW/IPPD),SE ...