Page 1 of 1

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

Posted: Tue Jun 11, 2013 11:13 am
by slw
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
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

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

Posted: Wed Jun 12, 2013 4:52 pm
by Support Team
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)

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

Posted: Thu Jun 13, 2013 8:42 am
by slw
Thank you for the information!