Re-write getTestSelector code