Automatically log clicks via Ranorex API

Class library usage, coding and language questions.
mr123
Posts: 1
Joined: Wed Jan 09, 2019 1:47 pm

Automatically log clicks via Ranorex API

Post by mr123 » Wed Jan 09, 2019 2:19 pm

I am using Ranorex API with Visual Studio and C#. Is there a possibility to automatically get entries for clicks, keyboard entries, etc into the report files without implementing an own logging mechanism?

Creating a report and filling it with custom entries by using is no problem:

Code: Select all

TestReport.Setup(ReportLevel.Debug, "C:\\myReport.rxlog", true);
Report.Start();
Report.Info("Log entry")
Report.End();
TestReport.SaveReport();
I know, that

Code: Select all

Validate.EnableReport = true;
brings Validation entries into the report and I am looking for something analog for clicks or other standard Ranorex UI interaction.

Thanks.

User avatar
RobinHood42
Posts: 299
Joined: Fri Jan 09, 2015 3:24 pm

Re: Automatically log clicks via Ranorex API

Post by RobinHood42 » Thu Jan 10, 2019 7:57 am

Hi,

I'm afraid that you will need to call Report.Log/Info/... to log to the Ranorex report, since even Ranorex creates this calls when automating with Ranorex recorder/studio:
Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Click item 'Explorer.Firefox' at Center.", repo.Explorer.FirefoxInfo, new RecordItemIndex(0));
            repo.Explorer.Firefox.Click();
            Delay.Milliseconds(200);
Cheers,
Robin :mrgreen: