Report.Log: how to provide data for "Open In Spy" button

Class library usage, coding and language questions.
slw
Posts: 9
Joined: Mon Apr 15, 2013 6:32 pm

Report.Log: how to provide data for "Open In Spy" button

Post by slw » Tue Jun 11, 2013 11:13 am

Hello,

I have code where I search HTML element and click on it:
public static void ClickOnItem(DivTag root, string itemName)
{			
	DivTag item = root.FindSingle<DivTag>(".//div[@innertext='"+ itemName + "']");
	
	Report.Log(ReportLevel.Info, "Mouse", "Click on item: " + itemName + "");
	item.Click();
}
Now comes the problem with Report.Log(): if I provide only 3 parameters:
  • ReportLevel level,
  • string category,
  • string message,
then in the Report (rxlog) for this log message I get only "Jump to Item" button but not "Open In Spy". This makes problems identification difficult.
ranorex_report_open_in_spy.png
ranorex_report_open_in_spy.png (2.86 KiB) Viewed 858 times
It seems that for "Open In Spy" to be shown, the 4th parameter "params IReportMetadata[] metaData" should be set as well. E.g. RepoItemInfo objects can be passed there.

The problem is that since I get my adapter using FindSingle() method I do not have the RepoItemInfo for it. So, my question is:
  • Is it possible to create RepoItemInfo dynamically either from Adapter or from the RanoreXPath
  • Or maybe it is possible to pass some other object as "params IReportMetadata[] metaData". In this case, how can I get it using the information I have (Adapter or RanoreXPath)
Thanks in advance

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Report.Log: how to provide data for "Open In Spy" button

Post by Support Team » Wed Jun 12, 2013 4:52 pm

Hello,

There is no direct way to create a RepoItemInfo object from a dynamically created adapter.
You need to use the repository item for that purpose.

I recommend you to create a repository item and use a variable for the innertext property.
Please take a look at our User Guide for more information.

Regards,
Markus (T)
.
Image

slw
Posts: 9
Joined: Mon Apr 15, 2013 6:32 pm

Re: Report.Log: how to provide data for "Open In Spy" button

Post by slw » Thu Jun 13, 2013 8:42 am

Thank you for the information!