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应用市场 ...
随机推荐
- python 高级函数
高级函数 map 格式:map(func, lt) 说明:接受两个参数,一个函数和一个可迭代对象,返回一个生成器,将func依次作用于lt 示例: l = [1,2,3,4,5]def double ...
- 多线程编程-- part5.1 互斥锁之公平锁-释放锁
释放公平锁 1.unlock() unlock()在ReentrantLock.java中实现的,源码如下: public void unlock() { sync.release(1); } 说明: ...
- v-bind:value="diy" 添加到 <input type="button" /> 中可以,添加到<button />中不可以,diy是data中的数据
v-bind:value="diy" 添加到 <input type="button" /> 中可以, 添加到<button />中不可 ...
- mybatis原理解析
本文是结合spring-mybatis整合进行的分析 1.先看看依赖的jar包: <dependency> <groupId>org.mybatis</groupId&g ...
- qq游戏IE组件停止工作
你可以下载一个腾讯电脑管家,利用电脑诊所里的腾讯游戏专区里的“网页游 游戏玩不了”这一项修复一下即可.我遇见一次,修复之后就解决了.个人认为是Adobe Flash出问题了.祝你玩的开心.
- Delphi 变量的作用域
- hadoop工作流程
一)任务流程 1)Mapreduce程序启动一个Jobclient实例,开启整个mapreduce作业 2)Jobclient通过getnewjobld()j接口向Jobtarker发出请求,以获得一 ...
- 火狐插件simple timer 定时打开指定网页
今天我要介绍的是火狐浏览器一款插件:Simple Timer,该插件是火狐一个可以添加计时器和定时提醒功能插件,该插件的主要作用就是当你的设置在某一个时刻提醒时,插件会自动弹出通知,并且自动打开你想要 ...
- struts配置访问后缀为.do,.action,.*
Struts 配置文件的加载顺序 Struts-default.xml---> struts-plugin.xml--> struts.xml--> struts.propert ...
- 代码自动补全插件CodeMix全新发布CI 2019.7.15|改进CSS颜色辅助
CodeMix是Eclipse的一款插件,它解锁了VS Code和Code OSS附加扩展的各种技术,支持各种语言. 作为Eclipse开发人员,您再也不必觉得自己已被排除在朋友使用Visual St ...