Page 1 of 1

IReportMetadata - what is the usecase?

Posted: Tue Sep 16, 2014 8:54 am
by rotciv
Hello
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
    RecordItemIndex

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,
rotciv

Re: IReportMetadata - what is the usecase?

Posted: Thu Sep 18, 2014 1:49 pm
by Support Team
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
The second window is shown when you didn't add this additional information:
NoMetadataInfo.png
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
I hope this post proves helpful for you :)!

Regards,
Markus