Forum Discussion

DCat1223's avatar
DCat1223
Frequent Contributor
7 years ago

Append Log Folder - Display Text String + Variable in Message Text on Error Log

Hi.  I'm hoping someone can help me out.  In an attempt to make my error log a bit more readable in a Keyword test, I'm trying to add a line to the beginning of the log using the Append Log Folder Logging Action.  I would like the Line of the folder to read, "Testing as [Role] [User]." Where Role and User are my Variables.  This is a VBScripted project by the way.  

 

I'm using the Code Expression mode in the Value of the MessageText field of the Operation Parameter.  

 

 

My Variables are Project Variables.  They are in an Excel Spreadsheet.  Each column houses a different variable.  I cannot seem to get this to work.  

 

The test picks up the variables fine but the logging isn't, and I'm sure it's syntax.  I've tried tweeking this statement so many different ways but to no avail.  The example above is obviously one of the failures, but I was hoping someone could get me straightened out. 

 

Thank you for your time.

Dave.

  • I actually just came up with a workaround that is going to work.  My variables are in an Excel sheet.  I basically created a new variable that is a concatonation of the cells using a basic excel formula:

    "Testing as" &A1&" - "&A2 where the variables i wanted in the string were in A1 and A2.

     

    Then instead of using the Code Expression mode on the parameter, I used Variable, with the Value being the Concatenated Variable in Excel.

     

    Again, I appreciate your assistance.  I was overthinking it I guess.