Synchronizing a test with an explicit wait