Add search function to test script