1. When you do a close on the pop-up window, sometimes it closes the window you are working in as well.
2. The "If...Then" statement works, but it can really slow down your script.
Here is how I corrected both issues:
1. Record the closing of the pop-up window and also the closing of the window under test. See if their objects in your object repository are unique enough. If not then add more description properties to the objects to make them unique. If that doesn't work, then try using Descriptive Programming (DP).
2. Determine how and when this pop-up appears. Use that to help make your script smarter about knowing that it exist and what to do to take care of it.
I my script every time I click on a tab on my web page called "Communications Zone" a pop-up appears. I don't mind that, but I want to close it after it appears. It doesn't appear if I click any other tab on my web page. So I used this code:
''Some code to setup the Tab variable.
If Tab = "Communications Zone" Then
That way it doesn't have to always check each time it gets to that web page or each tab. Only initially if it is using the tab "Communications Zone" or not in that particular test run.