Change string to propertied text for detecting end of popup
Refactoring some test cases