Click on Window Until Specific Text shown on Window

I want to click on sap window until the specific text appear on window.How can i do this?