Coded UI unexpected pop-up handling

I'm doing a Coded UI test and I have a problem with unexpected pop-ups. In the function below after doing the first step "main.Open..." I get a unexpected pop-up (bug in the software which is normal).

My Assert still go through as "Pass" because it captures the control that is in the background (pop-up is in the foreground at this point), this is the first thing that I found strange...how come it captures the background process??

Second, it never do the main.RemoveNavigatorResultsLogoFilter() and this is not reported in the output.html and this test actually PASSES!! I'm fairly new to Coded UI.

My Playback setting is :

Playback.PlaybackSettings.LoggerOverrideState = HtmlLoggerState.AllActionSnapshot;

Code:

        main.OpenNavigatorResultsLogoFilterWindow().SelectElementInNavigatorResultsLogoFilterList(logoName).ApplyNavigatorResultsLogoFilter();            
        Assert.IsTrue(String.Equals(logo.GetModifiedBy(), "VendorX"));            
        main.RemoveNavigatorResultsLogoFilter();

Answers


EDITED: I ended up putting in the "main" a check to ensure that my main form is "Enabled before doing an action. In my case the Root (aka TopParent) is my main form and pop-up have there own Root.

if (MainForm.Enabled)
        return MainForm;

Need Your Help

Is there a SQL technique for ordering by matching multiple criteria?

php sql mysql sorting

I have several tables that get JOINed together to form a table with columns