Added functionality to capture screenshot on failure of test case