cancel
Showing results for 
Search instead for 
Did you mean: 

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

SOLVED
DCat1223
Frequent Contributor

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.  

Snag_6a714b5.png

 

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

 

Snag_6a8808a.pngSnag_6a27a0f.png

 

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.

1 ACCEPTED SOLUTION

Accepted Solutions
DCat1223
Frequent Contributor

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

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.  

View solution in original post

4 REPLIES 4
Marsha_R
Community Hero

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

DCat1223
Frequent Contributor

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

Thanks, Marsha.  I did see that post early on and it didn't help.  I was hoping for some additional thoughts.  Thank you for replying though.  

Marsha_R
Community Hero

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

It would help us if you give an example that you tried and what the result was.  We can't guess what you did, but specific examples we can help you fix.

DCat1223
Frequent Contributor

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

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.  

View solution in original post

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors