Automated GUI refactoring and test script repair