Better fix for UI test case logic