Change target for "Jump To Item" in Ranorex Report.

Ask general questions here.
druiz
Posts: 11
Joined: Wed Jul 09, 2014 3:50 am

Change target for "Jump To Item" in Ranorex Report.

Post by druiz » Wed Sep 28, 2016 2:20 am

Hello,

Currently I am planning to add some extra information to the Report Lines in my code. Due to that I have decided to implement a new function on the side that will be in charge of doing it. The issue is that now the Ranorex Report will always send me to that function when I click on "Jump To Item" instead of sending me to the line of code that I need.

I think it will be easier to explain with an example

Utils Class.

Code: Select all

public class MyLogger
{
    public static bool logginRequired = false;
  
    public static void doLogging(msg)
    {
        if (logginRequired)
        {
            string modifiedMsg;
            //DO SOME STUFF TO THE MESSAGE
            Report.Info(modifiedMsg);
        }
    }
}
Test Module

Code: Select all

public class MyModule : ITestModule
{
    void ITestModule.Run()
    {
        //DO SOME TESTING
        MyLogger.doLogging(myMsg);
    }
}
Right now, when the test finish and the report is displayed, if I click on "Jump To Item", the code that will be shown is the one in 'MyLogger' class but I would like it to show the code in 'MyModule'. Is there any way to do that with Ranorex.

Thanks in advance for your help.

David

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3922
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Change target for "Jump To Item" in Ranorex Report.

Post by odklizec » Wed Sep 28, 2016 7:12 am

Hi,

I believe this is a known (and not yet fixed) Ranorex 6.x bug...
http://www.ranorex.com/forum/mouse-curs ... t9421.html
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

druiz
Posts: 11
Joined: Wed Jul 09, 2014 3:50 am

Re: Change target for "Jump To Item" in Ranorex Report.

Post by druiz » Wed Sep 28, 2016 7:31 am

Hello,

Thanks for your reply. But actually that's not my issue. My problem is that I have a function that wraps Report.Info() [see MyLogger.doLogging()] and then, whenever I need to add an 'Info' line to my code I call MyLogger.doLogging() instead of using Report.Info(). Like this I can avoid to replicate a lot of code every time I want to add a line to the log.

But then the problem is that everytime that I click on "Jump to Item" it will send me to MyLogger.doLogging() and what I want is that it would send me to the function that called it. Is there any way I could do that?

Thanks again.

David

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3922
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Change target for "Jump To Item" in Ranorex Report.

Post by odklizec » Wed Sep 28, 2016 8:03 am

Hi,

I believe it's connected? Jump to Item should always jump to the original line of code, no matter where the line of code is located? At least I remember it worked like that in 5.x reports? But maybe I remember it wrong? ;)
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

druiz
Posts: 11
Joined: Wed Jul 09, 2014 3:50 am

Re: Change target for "Jump To Item" in Ranorex Report.

Post by druiz » Thu Sep 29, 2016 2:57 am

Hello,

Thanks again for your reply but I believe I am not being able to express myself properly, sorry... Right now, the "Jump to Item" is working fine with me. When I click on it it goes to the line of code where the Report.Info() is called. The thing is that I do not want it to go there, I will like it to go to one level higher in the Stacktrace.

For example: I have a function1, that calls a function2 and this function2 calls Report.Info(). Once the report is shown, if I click on "Jump To Item" it will take me to the line in function2 where Report.Info() was called. But instead of that what I want is when I click on "Jump To Item" it would take me to the line of function1 where function2 was called. Is there something I could change / configure to do that?

NOTE: funtion1 and function2 are in different '.cs' files

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3922
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Change target for "Jump To Item" in Ranorex Report.

Post by odklizec » Thu Sep 29, 2016 7:40 am

Hi,

Sorry for misunderstanding from my side ;) I now see what you want. Unfortunately, I don't think there is something you can do about this at report level and I'm pretty sure there is no such option in Ranorex settings?
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Change target for "Jump To Item" in Ranorex Report.

Post by krstcs » Thu Sep 29, 2016 3:25 pm

If you want to have a report entry that jumps to the place you want in your user-code, you need to add a Report.Log() entry at the point in your code where you would like to jump. This does the same thing you are wanting without having to try and find way to manipulate what Ranorex already does.

So, if you have a library module that you want to be able to jump to when it fails, you need to add the Report.Info() line right before any actions in your library module that you want to report on and jump to.
Shortcuts usually aren't...