Forum Discussion

Vivek72's avatar
Vivek72
Contributor
10 years ago

Is it possible to assign variable to Log type?

Hi All,

Any chance I can assign a variable to Log type? What exactly i meant is that

msg1 = Log.Message, msg2 = Log.Checkpoint, msg3 = Log.Error, etc.?

 

Thanks for any inputs.

8 Replies

  • Marsha_R's avatar
    Marsha_R
    Champion Level 3

    Are you trying to save the message text or compare it or...?

    • Vivek72's avatar
      Vivek72
      Contributor

      Hi Marsha

       

      I created a function which can be used for positive testing (where data is expected to be shown in the grid) and negative testing (data is not expected to be shown in the grid). I use Log.Message and Log.Error consecutively. Now I need to replace those log functions with variable so I don't need to go into script every time based on what type of message I need.

       

      Thanks for response!

      • Marsha_R's avatar
        Marsha_R
        Champion Level 3

        I experimented a little and kept running in circles trying to evaluate those strings as objects and back again.

         

        Instead of passing in "Log.Message" and "Log.Error", could you pass in "M" or "E" and then choose the log statement inside the code?