How to integrate Ranorex with CruiseControl

Best practices, code snippets for common functionality, examples, and guidelines.
User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

How to integrate Ranorex with CruiseControl

Post by Support Team » Wed Dec 03, 2008 4:18 pm

We got the following question via private message:
I am planning to integrate Ranorex automation and CruiseControl.

My task is as soon as the CruiseControl build completes I want to invoke the Ranorex tool to run my acceptance test cases.

Is this possible? Any suggestions on this?
Ranorex can easily be integrated into continuous integration (CI) systems, e.g. CruiseControl for .NET (CCNet). Just create a task that calls your Ranorex executables (<exec> task in CCNet, other systems should support similar).
To evaluate the outcome of the test, CI systems usually examine the return value of the executable (return value 0 generally signals success) or the its output text (e.g. "TEST FAILED" for failure). So, just use either way to signal failure if your Ranorex code throws an exception (Ranorex code templates use this approach).

There's one thing you need to watch out for: Ranorex needs a logged on user, for the applications under test need a desktop to be displayed on to be available for automation. We recommend to create a distinct user on the build machine who is always logged on and who runs the Ranorex executables or better the CI application.
Also remember to disable screensavers and the automatic locking of the computer. The computer might get locked even if you try logging on to the machine via Remote Desktop. We recommend using a VNC application in order to guarantee that this does not happen.

If you got any questions, don't hesitate to post them :)

Regards,
Alex
Ranorex Support Team

TheDuze
Posts: 1
Joined: Sun Apr 05, 2009 12:22 am

Post by TheDuze » Thu Apr 23, 2009 10:31 am

Hi

I got this working with the 30 day trial rather fast. I really like your tool and it compiling an exe file.

Do you have a stylesheet that will make the result/report look great in CruiseControl. The one you supply isn't that great when put together with CC.net.
I merge the result together with the other results, so I have to fetch the result from the big build log file. Anything would be appreciated. I'm simply asking for a simple table showing what went ok and what failed :-)

Best regards
Martin

bbv_philippdolder
Posts: 10
Joined: Thu Nov 26, 2009 6:54 am

Re: How to integrate Ranorex with CruiseControl

Post by bbv_philippdolder » Thu Jul 15, 2010 11:59 am

Hello all

I'm trying to run my Ranorex Tests using NUnit-Console runner from out of our Continuous Integration environment which runs as service with Interactive Desktop enabled.

But Ranorex cannot find the UI Elements and times out.

Any idea how I can run the ranorex tests as NUnit tests?

Thanks in advance
Phil

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: How to integrate Ranorex with CruiseControl

Post by Support Team » Thu Jul 15, 2010 12:56 pm

Hi,

Please take a look to following Blog, how you use NUnit and Ranorex.
http://www.ranorex.com/blog/using-nunit ... -execution

Regards,
Peter
Ranorex Support Team
.
Image

bbv_philippdolder
Posts: 10
Joined: Thu Nov 26, 2009 6:54 am

Re: How to integrate Ranorex with CruiseControl

Post by bbv_philippdolder » Thu Jul 15, 2010 1:08 pm

Hi Peter,

When I run my Ranorex Tests using nUnit-console from within a cmd scripts that calls nant-target to run the tests, everything works as expected. (As I was using the info from the referenced blog post already)

But when NAnt is triggered from the Continuous Integration server it does not work and ends in a
"Ranorex.ElementNotFoundException : Failed to find item 'FormWindow1.MessageBox' within the specified timeout of 5000ms."

It's running on a Win XP 32-Bit machine.
The Ranorex Evaluation Licence Dialog Box shows up, so the Service seems to be able to interact with the desktop.
Any more ideas?

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: How to integrate Ranorex with CruiseControl

Post by Support Team » Thu Jul 15, 2010 3:06 pm

Hi,

There might be a problem automating Windows Forms applications (caused by Windows Security Policies) if the application under test is not started by the CruiseControl service, but the automating Ranorex executable is started by that service. Please, make sure that both the automating and the automated applications are started from the CruiseControl service.

The suggested way is to let CruiseControl be run by the current user and not as a service, e.g. by starting it when the user logs in (with a shortcut in the "Startup" start menu folder). That way, there should not be any problems caused by Windows security.

Regards,
Peter
Ranorex Support Team
.
Image

jstr
Posts: 4
Joined: Wed Mar 30, 2011 3:59 pm

Re: How to integrate Ranorex with CruiseControl

Post by jstr » Tue Apr 26, 2011 6:54 pm

I'm trying to run a Visual Studio Unit Test suite making Ranorex API calls. Have a simple .bat script that calls MSTest. Set it up as a Scheduled Task with user set to be logged in user. Machine set never to log out, or lock window, or run screensaver. It's running on a VMWare instance. If I have a console open to that instance all is well. If not, fails with CantFindElement exceptions. Any ideas? Asked Ranorex support and they pointed me here.

jstr
Posts: 4
Joined: Wed Mar 30, 2011 3:59 pm

Re: How to integrate Ranorex with CruiseControl

Post by jstr » Tue Apr 26, 2011 7:10 pm

jstr wrote:I'm trying to run a Visual Studio Unit Test suite making Ranorex API calls. Have a simple .bat script that calls MSTest. Set it up as a Scheduled Task with user set to be logged in user. Machine set never to log out, or lock window, or run screensaver. It's running on a VMWare instance. If I have a console open to that instance all is well. If not, fails with CantFindElement exceptions. Any ideas? Asked Ranorex support and they pointed me here.
Problem solved: open the Task Scheduler service, click on Logon, click "Allow service to interact with desktop". Then scheduled tasks will have access to the UI. This should work in general for any automation framework that runs Ranorex tests via scheduled tasks.

User avatar
artur_gadomski
Posts: 207
Joined: Mon Jul 19, 2010 6:55 am
Location: Copenhagen, Denmark
Contact:

Re: How to integrate Ranorex with CruiseControl

Post by artur_gadomski » Thu Jul 28, 2011 11:47 am

Is there any update on a style sheet?
I tried using RanorexReport3.xsl but it doesn't look quite right.
Has anybody managed to display Ranorex Reports on CC.net webdashboard?

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: How to integrate Ranorex with CruiseControl

Post by Support Team » Thu Jul 28, 2011 12:14 pm

Hi arthur,

I tried this too, but I had no success till yet. After my research, I arrived at the result it is simply not possible in an easy way. I guess you have to change the code of CC.Net to include a custom XSL like RanorexReport3.xsl.

Regards,
Peter
Ranorex Team
.
Image

User avatar
artur_gadomski
Posts: 207
Joined: Mon Jul 19, 2010 6:55 am
Location: Copenhagen, Denmark
Contact:

Re: How to integrate Ranorex with CruiseControl

Post by artur_gadomski » Thu Jul 28, 2011 12:24 pm

When you say
Support Team wrote:I guess you have to change the code of CC.Net to include a custom XSL like RanorexReport3.xsl.
Do you mean a way to include any xsl files, like the ones for MSTestresults and Ncover and all other ones. Or do you mean that there is extra custom stuff in Ranorex style sheet?

Not pretending to know anything about CC.Net and even less about xml and xsl:
Isn't it just a matter of comming up with a stylesheet that would be able to properly format reports?

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: How to integrate Ranorex with CruiseControl

Post by Support Team » Fri Jul 29, 2011 11:48 am

artur_gadomski wrote: Do you mean a way to include any xsl files, like the ones for MSTestresults and Ncover and all other ones. Or do you mean that there is extra custom stuff in Ranorex style sheet?
I mean a plug-in, where you can show a XML page with XSL like the ones for MSTest and NCover would be nice.

Regards,
Peter
Ranorex Team
.
Image

sauer-peters
Posts: 19
Joined: Wed Mar 14, 2012 9:20 am

Re: How to integrate Ranorex with CruiseControl

Post by sauer-peters » Wed Apr 18, 2012 12:44 pm

Maybe this links helps to solve the problem with Ranorex reports in CC.Net:
http://stackoverflow.com/questions/2549 ... ontrol-net

I did not try this because we have other priorities at the moment, but we will definitly try to find a solution to integrate the test reports with CC.Net dashboard. I will let you know if we found a something that works.

anja
Posts: 67
Joined: Fri Nov 26, 2010 3:39 pm

Re: How to integrate Ranorex with CruiseControl

Post by anja » Tue Apr 24, 2012 8:01 am

Hi,
we have integrated Ranorex with Jenkins. We simply call in a JenkinsJob the Exe via Commandline and later display the Report-File as XML Document.
The Tests are executed on a slave.

But sometimes a very strange error occurs: The whole PC gets a Bluescreen.
We analyzed this a little bit and following scenarios were the ones which are followed by bluescreen:
1. At the end of a job when Ranorex executable is completed (Last line in Console Logger: Test suite successfull and after this we get fatal errors because the PC has no longer responded)
2. Stopping the Job within Jenkins --> The slave should stop the execution and this was not working
3. Stopping Ranorex Test execution on the PC via "Break", then the PC crashed

It seems to me that the communication between the Jenkins Slave and Ranorex is not working correctly... any ideas on this topic, how we can solve it?

Thank you in advance

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: How to integrate Ranorex with CruiseControl

Post by Support Team » Fri Apr 27, 2012 2:57 pm

Hi,

We are sorry but we haven't heard about such an error before.
We even haven't heard that Ranorex causes a blue screen, which sounds very unlikely.
Can you please open a new forum entry with a appropriate topic, because this topic has "nothing" to do with your problem, except that it is also about continuous integration tools.
Are you able to reproduce the issue also on another machine or just on the specific one?

Thanks in advance!

Regards,
Markus
Ranorex Support Team
.
Image