51Testing软件测试论坛

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

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 3083|回复: 0
打印 上一主题 下一主题

转:Using Hudson as Selenium Grid for Continuous Integration

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2010-5-17 01:58:57 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
In my last post about Hudson integration with Selenium RC,I talked about how to use Hudson to drive your Selenium RC tests.This configuration would work fine in most scenarios.However this is not a optimized configuration if you want to take advantage of executing your tests in parallel.For e.g if you have two machines in your lab with FF 35,you might want to run RC tests on both machines at same time.

Selenium Grid offers this capabilities.Below I will discuss how to take advantage of this in a continuous integration process.

I strongly recommend that you try to setup Selenium Grid on your local machine first if you had no prior experience with Selenium Grid.There are some very good Selenium Grid demos available here

Step 1

Download and Install Selenium Grid plugin for Hudson.You should see a small icon on your Hudson home page.Clicking on which you would see the RC’s registered to this Selenium Grid

Step 2

Important before this step,make sure that you are able to ping the RC server from Hudson and viceversa.If they cannot see each other it will not work

Registering your RC to Selenium Grid.This took me quite a while to figure out,but the trick is in the way you register this RC.

ant -Denvironment=”/qalab_01/windowsxp_1/:*firefox”  -Dport=5555 -Dhost=10.63.87.192 -DhubURL=http://myhudson.com:4444 launch-remote-control

Let’s go through the parameters one by one,you should be familiar with the parameters if you did a local setup of Selenium Grid.

environment=Machine Name/Label Name:browerCommand (Look at my earlier post about Selenium Hudson Integration to understand how to setup machine names and label names)

port=Available port on the machine where you are launching RC

host=IP address of your RC machine

hubURL=location of your Hudson server (which also doubles up as Selenium Grid now)

Step 3

Repeat similar process for another RC and when you click on the Selenium icon on your Hudson page,you should see that there are two RC’s registered to this Selenium Grid.

Step 4

Configure your Hudson job to run on master(i.e Selenium Grid) and it will take care of assigning the jobs to correct RC

Some important resources that helped me during the setup are

Amit Easow’s post on Hudson integration

Unregistering the Selenium RC command by this Selenium Blog.The command is lifesaver and I am repeating a example here

http://localhost:4444/registration-manager/unregister?host=locahost&port=5556&environment=*iexplore

To give a recap,I used ANT,TestNG,Selenium Grid,Hudson to accomplish this.

One last thing,The Selenium server jar is part of the Selenium Grid plugin bundle.You might want to replace it with a version of Selenium server you like on the Hudson server.

原文
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

本版积分规则

关闭

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

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

GMT+8, 2024-11-24 07:26 , Processed in 0.066082 second(s), 27 queries .

Powered by Discuz! X3.2

© 2001-2024 Comsenz Inc.

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