Forum Discussion

gid_216's avatar
gid_216
Frequent Contributor
12 years ago

Unable to get proper Log in Test Result

Hi,



Suppose I am calling 2 different function from a routine. When I run the routine, the log from the called routine is also added to that of running one. It doesn't follow a hierarchy in log. The same happens when run from a project suite also.



Can any body please tell me is there any workaround to resolve this?



Thanks,



Deepak
  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi Deepak,


     


    The test results of the functions executing will be added to the same branch where results for your routing are posted. I suppose this is the behavior you observe, right?


     

  • gid_216's avatar
    gid_216
    Frequent Contributor
    Hi Tanya,



    I observe the same you posted. but this makes the report analysis bit complex if analysed some some other person in some other system. As in the system used for script execution, we can redirect to the routine by clicking the log. If the tool will provide some hierarchy in test log, it will be better for report analysis as the report may be analysed by client or higher authorities of organisation other than the automation engineer. Some reputed test automation tool provides this.



    Thanks,



    Deepak
  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi Deepak,


     


    For a better log analysis, you can create your own structure in the Test Log. Go through this article for details.


     

  • gid_216's avatar
    gid_216
    Frequent Contributor
    Hi Tanya, 



    Thanks for such useful post. Can you please guide me how can I lock the event using Log.LockEvent for the complete test set in project level or project suite level test run.



    Thanks,



    Deepak
  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi Deepak,


     


    The method obtains the number of events that will be blocked:


    Log.LockEvents(30)


     


    Actually, you can set the LogParams.Locked property to True in the OnLogEvent event handler to prevent all events from being posted to the log on the project level.