Helper functions for UI testing