Watir 1.8.7 how to use cruisecontrol for an unattended job

70 views
Skip to first unread message

Charles Richard

unread,
Jun 23, 2011, 8:31:26 AM6/23/11
to watir-...@googlegroups.com
Hi,

I've been trying for almost a month now to get my watir scripts to run unattended on a windows 2003 server machine.  They run fine if I'm logged in.  It seems from what I've read that the best way to do this is to use Cruise Control.

The only build tool i know is Maven and my knowledge is limited in that area.  So I'm looking for a beginner tutorial to understand how i would set up Cruise Control to run my watir scripts unattended.  I find it a bit weird that i need a build tool to do this because I don't really need my Watir scripts to return any results as they simply send an email to let me know if a certain area of our site is not working anymore.  But if learning how to do this helps me to get this working, I'll try to put some time into it.

So any help would be appreciated on the above!

Thank you!

Charles

Hugh McGowan

unread,
Jun 23, 2011, 8:53:30 AM6/23/11
to Watir General
We use Hudson/Jenkins for this and have been extremely pleased with
the solution. It's easy to install, use, has great output. Scaling and
adding additional slaves to run tests is a snap. It's got support for
most of the major version control systems and you can use it to run
scripts directly or trigger rake tasks. (It's a build tool too :)

Thanks!
Hugh

Charles Richard

unread,
Jun 23, 2011, 9:27:15 AM6/23/11
to watir-...@googlegroups.com
Hi Hugh,

Any chance you could give me a quick overhead of how that would work with Hudson.  We use Hudson here so it would be less of a learning curve but we don't run any Junit tests or anything like that yet so I've got no experience there.  Also would i need to use rake as well?

Cheers and thank you,
Charles


Hugh McGowan

unread,
Jun 23, 2011, 12:13:15 PM6/23/11
to Watir General
On the machine you want to run tests through, add it as a node to
Hudson (we use java web start). The label you give it is how you'll
identify the jobs it can service. Login to that node (eg remote
desktop) and bring up the Hudson site in the browser on that machine.
Find the node you created and hit the Launch button - that starts up
the slave on that node and you should see a little dialog that you can
minimize (you may need to install a JRE on the machine).

Now create a job for the script you want to run and set the 'Restrict
where the job can be run' and add that label you defined for the node.
Set up the source control so it can check out your latest test code
and then configure how you're going to build it. You can use a windows
command and call the script directly. I'd start with just getting what
you have working (you don't need to use rake and you can always do
that later). You can manually start the build to make sure it works
for you and once you have things running you can edit the job and
trigger it to run nightly, on source control triggers, etc.

You might need to get user permissions to do some of this, depending
on how your Hudson site is set up. Also there are quite a few plugins
and you may have to install some, depending on what Hudson currently
has configured. There are ones that will support different source
control systems (git, svn, cvs), rake, etc.

Hugh

Charles Richard

unread,
Jun 23, 2011, 12:38:47 PM6/23/11
to watir-...@googlegroups.com
Thank you!

Have a great day!

Cheers,
Charles


Hugh

Charles Richard

unread,
Jun 27, 2011, 9:55:48 AM6/27/11
to watir-...@googlegroups.com
One more question if that's ok.

If i setup another separate Hudson master instance on my server where i want my ruby scripts to run, should that work as well?

I tried this as I've read online that having a master hudson linux instance and a slave Windows instance could be quite problematic.  I've tried with the master Hudson on Windows where i want my ruby scripts to run and it does execute my ruby (watir) scripts but behaves as if if can't open an IE window interactively.

Thanks!

Cheers,
Charles

Hugh McGowan

unread,
Jun 27, 2011, 11:10:31 AM6/27/11
to Watir General
We've got it set up with a master Linux and Windows slaves and have
not had an issue. I was not able to get the slave running headless,
however, because the script on the windows slave would not run with
the correct permissions. We login as the user we want it to run as and
launch the process from the hudson site that creates a small popup
window once it's connected. Are you doing the same?

Hugh

Charles Richard

unread,
Jun 27, 2011, 2:54:43 PM6/27/11
to watir-...@googlegroups.com
Hi Hugh,

Thanks for the reply.

I do require a headless setup and i just discovered about Celerity today which is basically a headless Watir so i think I'll use this if I can.  I already tried one script and it ran fine on my linux box.  One script which is more complicated gave me an error but I'm hopeful that this will be the solution I was looking for.

Thanks!

Cheers,
Charles


Hugh

Reply all
Reply to author
Forward
0 new messages