Report.log not working in some circustances

Class library usage, coding and language questions.
orbistest
Posts: 23
Joined: Mon Oct 17, 2011 5:31 pm

Report.log not working in some circustances

Post by orbistest » Fri Sep 14, 2012 5:14 pm

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.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Report.log not working in some circustances

Post by Support Team » Mon Sep 17, 2012 4:18 pm

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

orbistest
Posts: 23
Joined: Mon Oct 17, 2011 5:31 pm

Re: Report.log not working in some circustances

Post by orbistest » Thu Sep 20, 2012 3:14 pm

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.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Report.log not working in some circustances

Post by Support Team » Thu Sep 20, 2012 5:30 pm

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