Page 1 of 1

Running Ranorex Tests as part of build process?

Posted: Thu Sep 23, 2010 6:31 pm
by Thor222
Hi - I'm looking for some best practices around running Ranorex based tests as part of a buid process. Our build process builds our product and exectutes our unit tests, but the build process is running as a service, and hence the Ranorex tests fail due to no UI (it would appear from a screenshot).

Wondering if anyone has some advice on how to best handle this? I could automate logging in to a remote machien and running the tests there, then copying back the results, but I'm looking for a cleaner / easier solution.

Re: Running Ranorex Tests as part of build process?

Posted: Thu Sep 23, 2010 7:10 pm
by Ciege
You can set up virtual PCs that can be cleaned and launched from your build scripts. The virtuals would have Ranorex installed on them and told to download your new AUT, install it, run the tests and report back.

1) Build script completes
2) Makes a call to VM Server to clean VM Test Image 1
3) Starts VM Test Image 1
4) Waits for VM Test Image to complete loading
5) Uses PSExec to launch your Ranorex code on the VM Test Image
6) Waits until PSExec has returned (i.e. when Ranorex has completed)

I've set up similar using VMWare as well as MS Virtual PC. Not too terribly difficult just time consuming getting all of your assets configured the way you want them.

Re: Running Ranorex Tests as part of build process?

Posted: Wed Jan 05, 2011 4:22 pm
by SDS_Eric
We use a similar outline to Ciege, with CruiseControl and Nant for C# projects:

1) CruiseControl triggered by SVN commit
2) CruiseControl runs Nant build
2.1) Nant build runs MSBuild, unit tests

** Multiple VM's running CruiseControl with Ranorex installed are waiting **

3) Ranorex VM's CruiseControl is triggered by build-server CruiseControl completion
4) Each VM CruiseControl runs automated test nant script
4.1) Nant script runs Ranorex tests as unit tests

Re: Running Ranorex Tests as part of build process?

Posted: Fri Jan 07, 2011 11:48 am
by Support Team
We at Ranorex have a similar approach to run automated tests against our nightly Ranorex setups. We as well have a build server and several Virtual Machines (VM) running and waiting to be notified. All machines are running CruiseControl as a user program, not as a service, because we had problems with Visual Studio(!) compiling correctly if CruiseControl was running as a service.

Our work flow looks like the following:
  1. CruiseControl on build server is triggered at certain time in the night
  2. Unit tests are run and a new setup is created
  3. CruiseControl on listening VMs are triggered
  4. Each VM gets the new setup from the build server and installs it
  5. Ranorex test source code is compiled with newly installed setup
  6. Ranorex tests are invoked both by command line and via NUnit, results reported to CruiseControl
Regards,
Alex
Ranorex Team

Re: Running Ranorex Tests as part of build process?

Posted: Fri Jan 07, 2011 5:51 pm
by daa
We're doing this using BuildBot and SVN. BuildBot has a master machine controlling several build slaves, at least one of which has a Ranorex runtime on it. The build scripts controlling the overnight build have a "run Ranorex tests" step in them, which catches the output and merges it into the general output stream, using the correct XML display for the .rxlog stuff. If you were to stay up until 2am and log into the slave box, you'd see all the tests busily beavering away.

Currently the test slave is a physical machine that permanently has a user logged into it so that Ranorex has a screen, but we're in the process of moving to virtual slaves. We don't expect this to make any difference apart from performance -- the current physical box is quite old.