Forum Discussion

wltjddms's avatar
wltjddms
New Contributor
2 years ago

I want to get the contents of the log during the test.

I want to get the contents of the log during the test to Update the contents of the Jira.

It is a structure to update to jira using OnLogError and OnStopTestCase, is there a way to get the message of log?

 

 

2 Replies

  • Hi wltjddms!

     

    We have a few different ways of working with log data and Jira as well. The 2 documents below cover how to access your log contents and interact with the Jira object. I think between these 2 you can find a solution that fits your use case. 

     

    Access Test Log Contents from Tests

    https://support.smartbear.com/testcomplete/docs/testing-with/log/working-with/from-tests.html

     

    Jira Object

    https://support.smartbear.com/testcomplete/docs/reference/program-objects/jira/index.html

     

    I hope this helps!

    • wltjddms's avatar
      wltjddms
      New Contributor

      Thank you npaisley .

      I can now get values from the log during the test.

       

       

       

       

      def LogTableDataExample():
      # # Obtains a collection of logs
      LogsCol = Project.Logs
      # # Obtains the first log item
      LogItem = LogsCol.LogItem[0]
      # # Obtains the first dataset
      DataSet = LogItem.Data[0]
      
      # # Obtains the total number of rows in the dataset
      Num = DataSet.RowCount
      Log.Message(Num)
      
      Row = DataSet.Rows[0]
      #DataC = Row.ChildRow[0]
      # # Obtains the message of the current row
      Val = Row.ValueByName["Message"]
      Log.Message(Val)

       

       

       

       



      I have another problem.

       

       

       

       

      Row = DataSet.Rows[0]

       

       

       


      I can get the message of the log using the code above.

      But I don't know if the message in that Row is error or normal.

      Can I know the status of that Row?

       

       

       

       

      Row.Status

       

       

       

       

      This code is impossible