Page 1 of 1

Ranorex log from VS from Jenkins

Posted: Fri May 03, 2013 9:12 am
by sop
Hi
we are using Jenkins as a system for CI executing mstests inside which I am trying to use ranorex logging (not exactly the way recommended in best practices)
so the code might look like that

Code: Select all

 [TestClass]
    public class Test1
    {
    [TestInitialize]
        public void MyTestInit()
        {
            TestReport.Setup(ReportLevel.Debug, @"logsreport.rxlog", true);
            TestReport.BeginTestSuite("Testsuite");
        }
       
        [TestMethod]
        public void TestMethod1()
        {
            TestReport.BeginTestCase("BeginTestCase");
            TestReport.BeginTestModule("Module1");
            Report.Debug("start application");
            ....
        }

    }

when the job is executed in jenkins it fails on ranorex logging providing the following message
MESSAGE:
Initialization method Ranorex_ExtractionCalculation.ExtractionCalculationTest.MyTestInit threw exception. Ranorex.Core.RanorexCoreException: Ranorex.Core.RanorexCoreException: Failed to load default plugins. Please reinstall Ranorex. ---> Ranorex.Core.RanorexCoreException: Failed to load plugins from assembly 'Ranorex.Plugin.Win32, Version=4.0.2.21666, Culture=neutral, PublicKeyToken=b798506b574ebc9a'. ---> Ranorex.Core.RanorexCoreException: Failed to initialize plugin 'win32'. ---> System.InvalidOperationException: Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application..
please find the full stack trace in the attachment
stacktrace.txt
all the same works fine if executed form Visual studio for example so it must have to do with jenkins

do you have any ideas?

thanks,
sop

Re: Ranorex log from VS from Jenkins

Posted: Mon May 06, 2013 1:02 pm
by Support Team
Hello,

This error occurs if Ranorex is not installed.
Please make sure that Ranroex is installed on the machine where you run the test using Jenkins.

Regards,
Bernhard

Re: Ranorex log from VS from Jenkins

Posted: Mon May 06, 2013 2:02 pm
by sop
sorry Ranorex is surely installed
as I said it works perfectly from Visual Studio - exactly the same code
moreover it works from Jenkins now and then when Window is restarted
it looks like some rights problem or the way how Jenkins executes the code from service or something

but it is ranorex logging specific as when I comment these lines the whole thing doesnt produce any error
so I am not sure if I need to use other logging mechanism instead which would be pity as I like the way ranorex report look like

Re: Ranorex log from VS from Jenkins

Posted: Fri May 10, 2013 4:37 pm
by Support Team
Hello,

In general, Jenkins should not be started as service.
Please read the blog "Integrating Ranorex Automation in Jenkins CI Process" on our website in order to get additional information how to use Ranorex in connection with Jenkins.

Regards,
Bernhard

Re: Ranorex log from VS from Jenkins

Posted: Mon May 13, 2013 7:49 pm
by sop
thank you