Is there any way to read / examine the contents of the current Editor session log?
I ask because I would like to examine the output code of an executable being run by the Process step in more detail than checking zero / nonzero.
I can add the program’s output to the log, so if I can examine the log I can find what I need.
Hi @tmunsell10 ,
I don’t recommend trying to parse the session log file.
I have two different ideas for this:
Listening to log events
Instead you can add a custom log listener like this:
class MyLogListener : ILogListener
{
public void EventsLogged(IEnumerable<Event> Events)
{
// process the events.
}
public void Flush()
{
// leave this empty
}
}
///...
Log.AddListener(new MyLogListener());
Output from Process Step
In OpenTAP 9.22, the process step actually has an output string property. If you have another test step with a string property, you can assign the output of process step to that step.
I like this solution, because it makes the second part easy to test in isolation from actually running the process.
You can try it like this:
- Add a process step and configure it to make some output.
- Add a Log Message step.
- Right click the Message property in the Log Message step and select assign output.
- In the drop down select the output property from the process step.