I am trying to have log messages in bold and italic but the following code does not work. I copied this code from Help:
// Specifies new attributes
var attr = Log.CreateNewAttributes();
attr.Bold = true;
attr.Italic = true;
// Applies these attributes to a message
Log.Message("My Text "+"" +"" + attr );
Could someone please tell me why this does not work?
attr should be a parameter for Log.Message(). You are concatenating everything into one string. Try using some commas [img]/images/graemlins/smile.gif[/img]
Lukasz Morawski, QA Engineer Cognifide testing blog PTaQ
To piggy back on Lukasz, you're syntax should be
Log.Message("Text of the messsage", "Extended Message Text", attr)
Automated Testing Evangelists
Definition expert - noun - Unknown drip under pressure
Luksz and Robert,
The code was straight from help section. Proposed solution gives a mismatch error. I tried putting in all required parameters and still got the same same error:
Ah, my bad... you need to add the priority parameter in.
Log.Message("Text of the messsage", "Extended Message Text", pmNormal, attr)
Robert is right. Thank you for reporting the issue with the help system articles. We will correct them.
Alex - SmartBear Support
Robert and Alex,
Thank you for your help, it works as expected.