Move that code into a setUp() block.
Capture the output into a variable.