Refactored uiautomation tests.

Results when running locally: Tests run: 223, Failures: 18, Errors: 0,
Skipped: 1