IReportMetadata - what is the usecase?

Class library usage, coding and language questions.
Posts: 26
Joined: Mon May 12, 2014 4:25 pm

IReportMetadata - what is the usecase?

Post by rotciv » Tue Sep 16, 2014 8:54 am

I reused the code from the recording module (in Visual Studio) and see that it is always using IReportMetadata
example is

Code: Select all

Report.Log(ReportLevel.Debug, "Keyboard", String.Format("Key sequence '{0}' with focus on 'ABC.Username'.", userName), repo.UsernameInfo, new RecordItemIndex(2));
in reporting it just gives
Key sequence 'test' with focus on 'ABC.Username'.
exactly the same as if I used Report.log providing null instead of two last arguments
I can not find any meaningful information about
  • IReportMetadata

the information in corresponding api pages says nothing to be honest
Could you provide more information about both classes - what they are for and how they can be used in report

thanks for your help,

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

Re: IReportMetadata - what is the usecase?

Post by Support Team » Thu Sep 18, 2014 1:49 pm

Hi Rotciv,

This information is not directly shown when you open the report but it helps you to get more information of a test action.
This Metadata array includes additional information like the RxPath of the used repository item or the saved RecordItemIndex which for instance allows you to jump to the correspondent action of the Recording when you open the report in Ranorex Studio.

A small sample to illustrate this:
Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Click item 'VipApp.Gender' at 8;14.", repo.VipApp.GenderInfo, new RecordItemIndex(2));
Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Click item 'VipApp.Gender' at 8;14.");
These two log methods log the same information to the report view, I mean the same report message is shown to the user when they open the report file, but when you for instance want to jump to the corresponding action of the recording or when you want to get more additional information about the action you need the Metadata array. Because you will just see the "Jump to item" link when this additional information is logged.
When you open the Report in Ranorex Studio it will jump to the specific action and the specific repository item is also highlighted. When you don't open it with Ranorex Studio a window will show up with more detailed information about the action, you will see the additional data which was saved in the Metedata array.
The first window is shown when you included additional information:
MetadataInfo.png (29.78 KiB) Viewed 1401 times
The second window is shown when you didn't add this additional information:
NoMetadataInfo.png (24.82 KiB) Viewed 1401 times
In case you work with Visual Studio there is no need to add the RecordItemIndex. I would just log the additional RepoItemInfo object. This will aditionally allow you to open the RxPath in Ranorex Spy:
OpenInSpy.png (7.18 KiB) Viewed 1401 times
I hope this post proves helpful for you :)!