51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 2596|回复: 1
打印 上一主题 下一主题

[原创] 5分钟创建Tellurium测试项目

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2009-3-14 12:37:24 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
Tellurium是一个开源的网页测试框架,现阶段还是建立在Selenium之上。 但有很多独特的测试理念。 比之Selenium, 维护性, 鲁棒性, 和可复用性都要好。 它支持JUnit, TestNG, 和GroovyTestCase. Tellurium有自己的Firefox Plugin和Maven archetype. 要创建一个Tellurium测试项目很简单, 用一个Maven命令就行, 比如

mvn archetype:create -DgroupId=example -DartifactId=demo  -DarchetypeArtifactId=tellurium-junit-archetype
-DarchetypeGroupId=tellurium
-DarchetypeVersion=1.0-SNAPSHOT

这个命令创建了Tellurium JUnit 测试项目。 当然, 在这之前,你必须把Tellurium Maven Repository加到你的Maven settings.xml文件中

<settings>
    <profiles>
        <profile>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <repositories>
                 <repository>  
                    <id>kungfuters-public-snapshots-repo</id>
                    <name>Kungfuters.org Public Snapshot Repository</name>
                    <releases>         
                        <enabled>false</enabled>
                    </releases>         
                    <snapshots>         
                        <enabled>true</enabled>
                    </snapshots>        
                    <url>http://kungfuters.org/nexus/content/repositories/snapshots</url>
                </repository>   
                <repository>   
                    <id>kungfuters-public-releases-repo</id>
                    <name>Kungfuters.org Public Releases Repository</name>
                    <releases>         
                        <enabled>true</enabled>
                    </releases>         
                    <snapshots>         
                        <enabled>false</enabled>
                    </snapshots>        
                    <url>http://kungfuters.org/nexus/content/repositories/releases</url>
                </repository>   
            </repositories>
        </profile>
    </profiles>
</settings>

然后用编辑器如IntelliJ IDEA打开项目用如下部步骤,

New Project > Import project from external model > Maven > Project directory > Finish

你会发现项目中有以下文件

pom.xml
src
src/main
src/main/groovy
src/main/resources
src/test
src/test/groovy
src/test/groovy/module
src/test/groovy/module/GoogleSearchModule.groovy
src/test/groovy/test
src/test/groovy/test/GoogleSearchTestCase.java
src/test/resources
TelluriumConfig.groovy

其中TelluriumConfig.groovy是Tellurium配置文件, 而GoogleSearchModule是示范网页模块文件, 而GoogleSearchTestCase是示范测试文件。
检查项目的Groovy配置, 确保是1.6.0版本。 然后就可以运行示范测试文件了。

Tellurium的Firefox Plugin(TrUMP)可以用来自动创建网页模块文件, 然后你加入测试逻辑就行了。 TrUMP可以从Tellurium网站下载

http://code.google.com/p/aost/downloads/list

或者从Firefox addons直接下载

https://addons.mozilla.org/en-US/firefox/addon/11035

如果有问题, 可到Tellurium用户组去提问

http://groups.google.com/group/tellurium-users

这个示范的在线版在

http://www.slideshare.net/John.Jian.Fang/ten-minutes-to-tellurium

此外Tellurium网站还有相关的视频下载。

[ 本帖最后由 johnfang 于 2009-3-14 12:54 编辑 ]
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

该用户从未签到

2#
 楼主| 发表于 2009-3-15 11:55:56 | 只看该作者

10 minutes to Tellurium

这是更新的wiki page

http://code.google.com/p/aost/wiki/TenMinutesToTellurium

其中增加了如何用TrUMP去创建自己的网页模块和创建新的测试代码。
并增加了视频演示

http://aost.googlecode.com/files/TenMinutesToTellurium.ogg

在线版

http://www.youtube.com/watch?v=DyUPeg-Y-Yg
回复 支持 反对

使用道具 举报

本版积分规则

关闭

站长推荐上一条 /1 下一条

小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

GMT+8, 2024-9-21 20:33 , Processed in 0.073553 second(s), 28 queries .

Powered by Discuz! X3.2

© 2001-2024 Comsenz Inc.

快速回复 返回顶部 返回列表