Forum Discussion

Babulu's avatar
Babulu
Contributor
9 years ago

Keyword Test to logs Folder in a script

Hi I have created 5 recorded keyword tests. I want to results with 5 different folders. How can i get the code . I am trying but its storing only one folder. Could You Please help me?

5 Replies

  • cunderw's avatar
    cunderw
    Community Hero

    Are you saying files system folders? Or expandable folders in the log itself? 

     

    If you want to create folders inside the log, these two functions should give you what you need.

     

    // creates a new sub-section in the log that is indented and collapsable
    function indentLog(sDescription) {
      var oAttr;
      oAttr = Log.CreateNewAttributes();
      oAttr.Bold = true;
      STEP_ID = Log.CreateFolder(sDescription, "", pmNormal, oAttr);
      Log.PushLogFolder(STEP_ID);
    }
    
    // restores to last position in the log
    function outdentLog(sExpected) {
        if(sExpected == undefined) {
          sExpected = "Finished";
        }
        Log.Message(sExpected);
        Log.PopLogFolder();
    }