Page 1 of 1

Report.log not working in some circustances

Posted: Fri Sep 14, 2012 5:14 pm
by orbistest
I have a recording which has a single line to call a piece of user code.
The user code will report to the log when I run the .rxrec but when the .rxrec is included in a suits .rxtst I get no logging.

What am I doing wrong?

Here is the code. with a number of different variations of attempts to log.
Public Sub CheckIfLoginExists()
        	report.Info("Validation", "Check if Login Exists")
                Report.Log(ReportLevel.Info, "Validation", "Check if Login Exists", repo.MainTCMenu.Shortcut_BarInfo, New RecordItemIndex(-1))
	            Report.Log(ReportLevel.Info, "Validation", "Check if Login Exists", repo2.TaskCentreDialogs.Login.SelfInfo, New RecordItemIndex(-1))
            If repo2.TaskCentreDialogs.Login.SelfInfo.Exists() Then
	            Report.Log(ReportLevel.Info, "Validation", "Login Exists - Will fill in Login Form.", repo2.TaskCentreDialogs.Login.SelfInfo, New RecordItemIndex(-1))
            	'Login.Instance.varPassword = TCPassword
            	'Login.Start()
            Else
	            Report.Log(ReportLevel.Info, "Validation", "Login Form Does Not Exist - No Action Required.", repo2.TaskCentreDialogs.Login.SelfInfo, New RecordItemIndex(-1))
            End If
        End Sub

Any help appreciated.

Re: Report.log not working in some circustances

Posted: Mon Sep 17, 2012 4:18 pm
by Support Team
Hello,

How did you include the recording into the test suite? Please make sure that the recording and the testcase where it is included is not disabled. Does it work if you make a Report action within the recording and not in the user code? Please make sure that the recording is executed in your test run.
Which version of Ranorex is installed on your system?
Is it possible to get a little example to reproduce this issue?

Regards,
Bernhard
Ranorex Support Team

Re: Report.log not working in some circustances

Posted: Thu Sep 20, 2012 3:14 pm
by orbistest
Interestingly, I had to do two things which I think have fixed the problem.
Firstly I discovered that the report path was blank. I filled this in as I wanted all my reports in a particular folder.
Then changed the report level on the recording (rt-click, report level) to something different - my message did not show - then back again and now it reports fine.

What I don't understand is why the reporting seemed to be working if I ran the recording on its own but not as part of the suite. Maybe it is because the recording level was set to "inherit" and at some higher level the info messages are not required.

Anyway, things seem to be fine now.
Thanks.

Re: Report.log not working in some circustances

Posted: Thu Sep 20, 2012 5:30 pm
by Support Team
Hello,

I'm glad to hear that it works now. Indeed the Report level is set to 'Inherit' by default, which means that the test case inherits the setting from its parent (test case or test suite).

Regards,
Bernhard
Ranorex Support Team