开源自动化测试框架Tellurium

发表于:2014-3-05 11:45

字体: | 上一篇 | 下一篇 | 我要投稿

 作者:虫师    来源:51Testing软件测试网采编

  打开的你的命令提示符,切换到你的工作空间的目录下,运行下列Maven命令来创建一个新的Tellurium测试方案(项目)"demo"
  mvn archetype:generate -DgroupId=example -DartifactId=demo -DarchetypeArtifactId=tellurium-junit-archetype -DarchetypeGroupId=tellurium -DarchetypeVersion=0.6.0
  然后切换到该项目的目录下执行:mvn  eclipse:eclipse   构建成我们的eclipse所能识别的项目结构。
  打开Eclipse将我们构建完成的项目导入。完成后项目结构如下:
  在Telluriumconfig.groovy文件中包含Tellurium项目设置,你能根据你的需求对它进行自定义设置
tellurium{
//embedded selenium server configuration
embeddedserver {
//port number
port = "4444"
//whether to use multiple windows
useMultiWindows = false
//whether to run the embedded selenium server. If false, you need to manually set up a selenium server
runInternally = true
//profile location
profile = ""
//user-extension.js file, for example, "target/test-classes/extension/user-extensions.js"
userExtension = ""
}
//event handler
eventhandler{
//whether we should check if the UI element is presented
checkElement = false
//wether we add additional events like "mouse over"
extraEvent = true
}
//data accessor
accessor{
//whether we should check if the UI element is presented
checkElement = true
}
connector{
//selenium server host
//please change the host if you run the Selenium server remotely
serverHost = "localhost"
//server port number the client needs to connect
port = "4444"
//base URL
baseUrl = "http://localhost:8080"
//Browser setting, valid options are
//  *firefox [absolute path]
//  *iexplore [absolute path]
//  *chrome
//  *iehta
browser = "*chrome"
//user's class to hold custom selenium methods associated with user-extensions.js
//should in full class name, for instance, "com.mycom.CustomSelenium"
customClass = ""
}
datadriven{
dataprovider{
//specify which data reader you like the data provider to use
//the valid options include "PipeFileReader", "CVSFileReader" at this point
reader = "PipeFileReader"
}
}
test{
//at current stage, the result report is only for tellurium data driven testing
//we may add the result report for regular tellurium test case
result{
//specify what result reporter used for the test result
//valid options include "SimpleResultReporter", "XMLResultReporter", and "StreamXMLResultReporter"
reporter = "XMLResultReporter"
//the output of the result
//valid options include "Console", "File" at this point
//if the option is "File", you need to specify the file name, other wise it will use the default
//file name "TestResults.output"
output = "Console"
//test result output file name
filename = "TestResult.output"
}
exception{
//whether Tellurium captures the screenshot when exception occurs.
//Note that the exception is the one thrown by Selenium Server
//we do not care the test logic errors here
captureScreenshot = true
//we may have a series of screenshots, specify the file name pattern here
//Here the ? will be replaced by the timestamp and you might also want to put
//file path in the file name pattern
filenamePattern = "Screenshot?.png"
}
}
uiobject{
builder{
//user can specify custom UI objects here by define the builder for each UI object
//the custom UI object builder must extend UiObjectBuilder class
//and implement the following method:
//
// public build(Map map, Closure c)
//
//For container type UI object, the builder is a bit more complicated, please
//take the TableBuilder or ListBuilder as an example
//example:
//        Icon="org.tellurium.builder.IconBuilder"
}
}
widget{
module{
//define your widget modules here, for example Dojo or ExtJs //
included="dojo, extjs"
included=""
}
}
}
42/4<1234>
《2023软件测试行业现状调查报告》独家发布~

关注51Testing

联系我们

快捷面板 站点地图 联系我们 广告服务 关于我们 站长统计 发展历程

法律顾问:上海兰迪律师事务所 项棋律师
版权所有 上海博为峰软件技术股份有限公司 Copyright©51testing.com 2003-2024
投诉及意见反馈:webmaster@51testing.com; 业务联系:service@51testing.com 021-64471599-8017

沪ICP备05003035号

沪公网安备 31010102002173号