Added exception handling for creating testcases when records do not exist