How to log information in VS to see it in VSE log?

Document ID : KB000112450
Last Modified Date : 29/08/2018
Show Technical Document Details
Sometimes, we need to find out some information from the VS which we can't see it in inspection view.
How to log information in VS to see it in VSE log?
Al suported DevTest environments.
To log the information in the VSE logs, add the code in a scripted assertion in the VSM steps. For example, see the below code
-------" Service = {}, Step = {} And Data is: {}", 
"My Virtual Service Name Here", 
testExec.getStateValue( "LISA_LAST_STEP" ), 
testExec.getStateValue("accountNumber") ); 
// log additional values here" Getting List of Virtual Services"); 
return true;

VSE log will show information like below based on the above code
Service = {"My Virtual Service Name Here"}, Step = {the value of "testExec.getStateValue( "LISA_LAST_STEP" );" } And Data is: {the value of "testExec.getStateValue("accountNumber") ); "}"
Getting List of Virtual Services

Note: You can always "return true;" in the code and do the assertion logic as "If False to Fail" (which will  never happen.