Please add this part in a try finally block. If the test fails at previous steps, this will not execute.